Permalink
Browse files

Fix incorrect asset paths in development when using asset_path helper…

… inside .js.erb/.css.erb for Passenger. #3365
  • Loading branch information...
1 parent 9147613 commit 53cebf7eb80d6b97c21c421cbc7d1f572170e33f @pokonski pokonski committed Dec 12, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -54,6 +54,7 @@ def stylesheet_link_tag(*sources)
def asset_path(source, options = {})
source = source.logical_path if source.respond_to?(:logical_path)
path = asset_paths.compute_public_path(source, asset_prefix, options.merge(:body => true))
+ path = ENV['RAILS_RELATIVE_URL_ROOT'] + path if ENV['RAILS_RELATIVE_URL_ROOT'] && config.relative_url_root.nil?
options[:body] ? "#{path}?body=1" : path
end
alias_method :path_to_asset, :asset_path # aliased to avoid conflicts with an asset_path named route

0 comments on commit 53cebf7

Please sign in to comment.