diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-08-24 07:46:04 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-08-24 07:46:04 -0700 |
commit | 23d8a980d24e8969dc71500378055dfedc9286ca (patch) | |
tree | 1a8cd68d12c76879fdbf291ceb7abad3782e750d /actionpack/lib | |
parent | 52207ecc81816140c05d216164aa745cf652f3b3 (diff) | |
parent | d133fd6d290a4812a17cc58c0d7e5cd3895e23f6 (diff) | |
download | rails-23d8a980d24e8969dc71500378055dfedc9286ca.tar.gz rails-23d8a980d24e8969dc71500378055dfedc9286ca.tar.bz2 rails-23d8a980d24e8969dc71500378055dfedc9286ca.zip |
Merge pull request #2668 from guilleiguaran/debug-assets-media-type
Debug assets shouldn't ignore media type for stylesheets. Closes #2625
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/sprockets/helpers/rails_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index 4fb8d0af37..a32fb1c57e 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -43,17 +43,18 @@ module Sprockets options = sources.extract_options! debug = options.key?(:debug) ? options.delete(:debug) : debug_assets? body = options.key?(:body) ? options.delete(:body) : false + media = options.key?(:media) ? options.delete(:media) : "screen" sources.collect do |source| if debug && asset = asset_paths.asset_for(source, 'css') asset.to_a.map { |dep| - stylesheet_link_tag(dep, :debug => false, :body => true) + stylesheet_link_tag(dep, :media => media, :debug => false, :body => true) }.join("\n").html_safe else tag_options = { 'rel' => "stylesheet", 'type' => "text/css", - 'media' => "screen", + 'media' => media, 'href' => asset_path(source, 'css', body, :request) }.merge(options.stringify_keys) |