提交 e0db9cb1 编写于 作者: G Guillermo Iguaran

Use super in javascript_include_tag and stylesheet_link_tag instead of generate tags manually

上级 c5a52850
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册