I initially created an issue on rails/sprockets-rails, but identified the cause by digging into why it's happening.
removes request.script_name being prepended to asset urls
- fixes an issue where asset paths from within an engine are prepended with where the engine was mounted
- issue documented at https://github.com/jejacks0n/sprockets_engine
- clarification pending at rails/rails@e6451a5
/cc @spastorino @josevalim
Assets URLs within the app should respect SCRIPT_NAME without having to set relative_url_root, so 👎 on this change. However, asset URLs within a mounted engine should use the app's SCRIPT_NAME, but that info is not available to the engine (yet).
How about exposing a new Rack env var for the root asset path? The app (or sprockets?) would set the root asset path based on SCRIPT_NAME and the engine wouldn't modify it.
@jeremy That sounds like a great idea!
I'm good with whatever. Just wanted to bring it to light and try to help out -- whatever the end solution is. :)
Agree with @jeremy script_name shouldn't be removed from there
How should I proceed? I'm happy to open an issue and close this request. To me it was more about getting the issue I opened in rails/sprocket-rails clarified than getting this specific fix in.
@jejacks0n thanks, looks like a patch very similar to this was applied already and the error should be fixed now!!!
Awesome! Thanks for the follow up. =)
For reference 445f14e
Isn't that commit the same as this one was? =)