aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2011-08-24 15:54:47 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2011-08-24 15:54:47 -0500
commite0db9cb17d37dfa9edb1d3ff86095c696b8f002a (patch)
tree0e2c9400d81d0cdb554ae4710a4d6cb4f0367eb3 /actionpack
parentc5a52850b3e2d0d1823f36d8d3afd9dc849cfddd (diff)
downloadrails-e0db9cb17d37dfa9edb1d3ff86095c696b8f002a.tar.gz
rails-e0db9cb17d37dfa9edb1d3ff86095c696b8f002a.tar.bz2
rails-e0db9cb17d37dfa9edb1d3ff86095c696b8f002a.zip
Use super in javascript_include_tag and stylesheet_link_tag instead of generate tags manually
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/sprockets/helpers/rails_helper.rb16
1 files changed, 2 insertions, 14 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb
index 93ea7206a1..931d7a93a4 100644
--- a/actionpack/lib/sprockets/helpers/rails_helper.rb
+++ b/actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -29,12 +29,7 @@ module Sprockets
javascript_include_tag(dep, :debug => false, :body => true)
}
else
- tag_options = {
- 'type' => "text/javascript",
- 'src' => asset_path(source, 'js', body)
- }.merge(options.stringify_keys)
-
- content_tag 'script', "", tag_options
+ super(source.to_s, { 'src' => asset_path(source, 'js', body) }.merge!(options.stringify_keys))
end
end.join("\n").html_safe
end
@@ -51,14 +46,7 @@ module Sprockets
stylesheet_link_tag(dep, :media => media, :debug => false, :body => true)
}
else
- tag_options = {
- 'rel' => "stylesheet",
- 'type' => "text/css",
- 'media' => media,
- 'href' => asset_path(source, 'css', body, :request)
- }.merge(options.stringify_keys)
-
- tag 'link', tag_options
+ super(source.to_s, { 'href' => asset_path(source, 'css', body, :request), 'media' => media }.merge!(options.stringify_keys))
end
end.join("\n").html_safe
end