requirejs-rails icon indicating copy to clipboard operation
requirejs-rails copied to clipboard

relative_url_root path is not handled

Open nvenky opened this issue 12 years ago • 0 comments

When I tried to start the server with Relative url root, the JS path generated by the gem does not take that into account.

RAILS_RELATIVE_URL_ROOT='/myapp' rails s 

The JS URL is still pointing to http://localhost:3000/assets/application.js instead of http://localhost:3000/share/assets/application.js

When I looked at the rails code, I could see the following code in the asset_url_helper.rb.

actionpack/lib/action_view/helpers/asset_url_helper.rb

relative_url_root = defined?(config.relative_url_root) && config.relative_url_root
if relative_url_root
  source = "#{relative_url_root}#{source}" unless source.starts_with?("#{relative_url_root}/")
end

nvenky avatar Jun 18 '13 01:06 nvenky