Skip to content
This repository
Browse code

Preserve stylesheet_link_tag and javascript_include_tag options on debug

  • Loading branch information...
commit 23b5c5522160928005b0aa949b3f9a894e2618aa 1 parent e0db9cb
Guillermo Iguaran authored August 24, 2011
7  actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -26,7 +26,7 @@ def javascript_include_tag(*sources)
26 26
         sources.collect do |source|
27 27
           if debug && asset = asset_paths.asset_for(source, 'js')
28 28
             asset.to_a.map { |dep|
29  
-              javascript_include_tag(dep, :debug => false, :body => true)
  29
+              javascript_include_tag(dep, options.stringify_keys.merge!({ :debug => false, :body => true }))
30 30
             }
31 31
           else
32 32
             super(source.to_s, { 'src' => asset_path(source, 'js', body) }.merge!(options.stringify_keys))
@@ -38,15 +38,14 @@ def stylesheet_link_tag(*sources)
38 38
         options = sources.extract_options!
39 39
         debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
40 40
         body  = options.key?(:body)  ? options.delete(:body)  : false
41  
-        media = options.key?(:media) ? options.delete(:media) : "screen"
42 41
 
43 42
         sources.collect do |source|
44 43
           if debug && asset = asset_paths.asset_for(source, 'css')
45 44
             asset.to_a.map { |dep|
46  
-              stylesheet_link_tag(dep, :media => media, :debug => false, :body => true)
  45
+              stylesheet_link_tag(dep, options.stringify_keys.merge!({ :debug => false, :body => true }))
47 46
             }
48 47
           else
49  
-            super(source.to_s, { 'href' => asset_path(source, 'css', body, :request), 'media' => media }.merge!(options.stringify_keys))
  48
+            super(source.to_s, { 'href' => asset_path(source, 'css', body, :request) }.merge!(options.stringify_keys))
50 49
           end
51 50
         end.join("\n").html_safe
52 51
       end

0 notes on commit 23b5c55

Aaron Patterson

Should :debug and :body be strings too? I don't like that we're mixing string and symbol keys in this hash.

Guillermo Iguaran

ok, I will change it and send a pull request

Santiago Pastorino

Ouch yup that's wrong. My bad since I was helping Guillermo ;).

Guillermo Iguaran

@spastorino, go catch, we can remove it without side effects!!!

Please sign in to comment.
Something went wrong with that request. Please try again.