Skip to content

Commit

Permalink
Use ProcessedAsset#pathname in Sprockets helpers when debugging is on.
Browse files Browse the repository at this point in the history
…Closes rails#3333 rails#3348 rails#3361.

Is wrong use ProcessedAsset#to_s since it returns the content of the file.
  • Loading branch information
guilleiguaran committed Dec 10, 2011
1 parent cd7fbcb commit 7a7e87d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actionpack/lib/sprockets/helpers/rails_helper.rb
Expand Up @@ -26,7 +26,7 @@ def javascript_include_tag(*sources)
sources.collect do |source|
if debug && asset = asset_paths.asset_for(source, 'js')
asset.to_a.map { |dep|
super(dep.to_s, { :src => path_to_asset(dep, :ext => 'js', :body => true, :digest => digest) }.merge!(options))
super(dep.pathname.to_s, { :src => path_to_asset(dep, :ext => 'js', :body => true, :digest => digest) }.merge!(options))
}
else
super(source.to_s, { :src => path_to_asset(source, :ext => 'js', :body => body, :digest => digest) }.merge!(options))
Expand All @@ -43,7 +43,7 @@ def stylesheet_link_tag(*sources)
sources.collect do |source|
if debug && asset = asset_paths.asset_for(source, 'css')
asset.to_a.map { |dep|
super(dep.to_s, { :href => path_to_asset(dep, :ext => 'css', :body => true, :protocol => :request, :digest => digest) }.merge!(options))
super(dep.pathname.to_s, { :href => path_to_asset(dep, :ext => 'css', :body => true, :protocol => :request, :digest => digest) }.merge!(options))
}
else
super(source.to_s, { :href => path_to_asset(source, :ext => 'css', :body => body, :protocol => :request, :digest => digest) }.merge!(options))
Expand All @@ -57,7 +57,7 @@ def asset_path(source, options = {})
options[:body] ? "#{path}?body=1" : path
end
alias_method :path_to_asset, :asset_path # aliased to avoid conflicts with an asset_path named route

def image_path(source)
path_to_asset(source)
end
Expand Down

0 comments on commit 7a7e87d

Please sign in to comment.