requirejs-rails
requirejs-rails copied to clipboard
relative_url_root path is not handled
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