aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2010-11-14 22:13:17 +0100
committerJosé Valim <jose.valim@gmail.com>2010-11-16 00:04:36 +0100
commit1c129f8f8ea5b10605ad77af6064c983584d463d (patch)
tree718d76b22c52fa863e61fcc39e4e8a4c22fce982 /actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb
parent91b0b6583428edaec1507c8dbfccfb2056bdedb4 (diff)
downloadrails-1c129f8f8ea5b10605ad77af6064c983584d463d.tar.gz
rails-1c129f8f8ea5b10605ad77af6064c983584d463d.tar.bz2
rails-1c129f8f8ea5b10605ad77af6064c983584d463d.zip
separated the asset id methods to a separate module, removed some dupliation with the various path methods, and moved the base asset tag methods to a base module so the asset id module can play nice with the path generation
Diffstat (limited to 'actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb')
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb
index ea8ac3f9a1..668a6136bc 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb
@@ -1,8 +1,14 @@
+require 'active_support/concern'
+require 'action_view/helpers/asset_tag_helpers/helper_methods'
+
module ActionView
module Helpers
module AssetTagHelper
+
module JavascriptTagHelpers
extend ActiveSupport::Concern
+ extend HelperMethods
+ include SharedHelpers
included do
mattr_accessor :javascript_expansions
@@ -37,10 +43,7 @@ module ActionView
# javascript_path "/dir/xmlhr" # => /dir/xmlhr.js
# javascript_path "http://www.railsapplication.com/js/xmlhr" # => http://www.railsapplication.com/js/xmlhr
# javascript_path "http://www.railsapplication.com/js/xmlhr.js" # => http://www.railsapplication.com/js/xmlhr.js
- def javascript_path(source)
- compute_public_path(source, 'javascripts', 'js')
- end
- alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with a javascript_path named route
+ asset_path :javascript, 'js'
# Returns an HTML script tag for each of the +sources+ provided. You
# can pass in the filename (.js extension is optional) of JavaScript files
@@ -174,7 +177,9 @@ module ActionView
end
return sources
end
+
end
+
end
end
end \ No newline at end of file