Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processor context #5

Open
brewster1134 opened this issue May 16, 2012 · 0 comments
Open

processor context #5

brewster1134 opened this issue May 16, 2012 · 0 comments

Comments

@brewster1134
Copy link
Contributor

I noticed that in the specs, the test FakeContext logical path is /assets/css/jada.css. But while playing around with urlrewriter, I noticed that sprockets uses a relative url from the loaded asset_path. So the actual context used in the example would just be jada.css

I noticed this after assets were failing when config.assets.debug was true (so basically the default development env) since the rewritten url was actually relative to /assets instead of being absolute and including '/assets' directly in the new url.

As a temporary fix I am conditionally registering the preprocessor...

Rails.application.assets.register_preprocessor 'text/css', Sprockets::UrlRewriter unless Rails.application.config.assets.debug

But it would be better to inject Rails.application.config.assets.prefix into the new url but not sure the best way to do that. maybe need a railtie?

thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant