Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use super in javascript_include_tag and stylesheet_link_tag instead o…

…f generate tags manually
  • Loading branch information...
commit e0db9cb17d37dfa9edb1d3ff86095c696b8f002a 1 parent c5a5285
@guilleiguaran guilleiguaran authored
Showing with 2 additions and 14 deletions.
  1. +2 −14 actionpack/lib/sprockets/helpers/rails_helper.rb
View
16 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -29,12 +29,7 @@ def javascript_include_tag(*sources)
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 @@ def stylesheet_link_tag(*sources)
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
Please sign in to comment.
Something went wrong with that request. Please try again.