diff options
author | wycats <wycats@gmail.com> | 2011-05-23 16:29:20 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2011-05-23 16:45:26 -0700 |
commit | 76f947edf755f57ec721b412c6cef9a9c2c8f4b5 (patch) | |
tree | 8933f54823eb262c9ba0505246615c8696feff7f /actionpack/lib/action_view | |
parent | 4b7902949022d1293ad71e8c25e64635b143ae89 (diff) | |
download | rails-76f947edf755f57ec721b412c6cef9a9c2c8f4b5.tar.gz rails-76f947edf755f57ec721b412c6cef9a9c2c8f4b5.tar.bz2 rails-76f947edf755f57ec721b412c6cef9a9c2c8f4b5.zip |
Move javascript/css helpers into the Sprockets helper and just have them override the old behavior
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/sprockets_helper.rb | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/actionpack/lib/action_view/helpers/sprockets_helper.rb b/actionpack/lib/action_view/helpers/sprockets_helper.rb index c9e6bcaa3f..04558438f7 100644 --- a/actionpack/lib/action_view/helpers/sprockets_helper.rb +++ b/actionpack/lib/action_view/helpers/sprockets_helper.rb @@ -9,49 +9,6 @@ module ActionView params[:debug_assets] == 'true' end - def asset_path(source, default_ext = nil, body = false) - source = source.logical_path if source.respond_to?(:logical_path) - path = asset_paths.compute_public_path(source, 'assets', default_ext, true) - body ? "#{path}?body=1" : path - end - - def sprockets_javascript_include_tag(source, options = {}) - debug = options.key?(:debug) ? options.delete(:debug) : debug_assets? - body = options.key?(:body) ? options.delete(:body) : false - - if debug && asset = asset_paths.asset_for(source, 'js') - asset.to_a.map { |dep| - sprockets_javascript_include_tag(dep, :debug => false, :body => true) - }.join("\n").html_safe - else - options = { - 'type' => "text/javascript", - 'src' => asset_path(source, 'js', body) - }.merge(options.stringify_keys) - - content_tag 'script', "", options - end - end - - def sprockets_stylesheet_link_tag(source, options = {}) - debug = options.key?(:debug) ? options.delete(:debug) : debug_assets? - body = options.key?(:body) ? options.delete(:body) : false - - if debug && asset = asset_paths.asset_for(source, 'css') - asset.to_a.map { |dep| - sprockets_stylesheet_link_tag(dep, :debug => false, :body => true) - }.join("\n").html_safe - else - options = { - 'rel' => "stylesheet", - 'type' => "text/css", - 'media' => "screen", - 'href' => asset_path(source, 'css', body) - }.merge(options.stringify_keys) - - tag 'link', options - end - end end end end |