You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...
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 bejada.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?
The text was updated successfully, but these errors were encountered: