removes request.script_name being prepended to asset urls #8712

Closed
wants to merge 1 commit into from

5 participants

@jejacks0n

I initially created an issue on rails/sprockets-rails, but identified the cause by digging into why it's happening.

@jejacks0n jejacks0n 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
83c5fda
@jejacks0n jejacks0n referenced this pull request in rails/sprockets-rails Jan 3, 2013
Closed

loading assets via mountable engine in rails 4 #32

@pboling

👍

@guilleiguaran
Ruby on Rails member
@jeremy
Ruby on Rails member

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.

@pboling

@jeremy That sounds like a great idea!

@jejacks0n

I'm good with whatever. Just wanted to bring it to light and try to help out -- whatever the end solution is. :)

@spastorino
Ruby on Rails member

Agree with @jeremy script_name shouldn't be removed from there

@jejacks0n

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.

@guilleiguaran
Ruby on Rails member

@jejacks0n thanks, looks like a patch very similar to this was applied already and the error should be fixed now!!!

@jejacks0n

Awesome! Thanks for the follow up. =)

@jejacks0n jejacks0n referenced this pull request in bradphelan/jasminerice Jan 27, 2013
Merged

Rails 4 routing #94

@guilleiguaran
Ruby on Rails member

For reference 445f14e

@jejacks0n

Isn't that commit the same as this one was? =)

@jejacks0n jejacks0n referenced this pull request in modeset/teaspoon Apr 23, 2013
Closed

Is my SpecController running slow? #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment