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 have an app that uses absolute path (it loads some static files (css/js/fonts) from a gem) and noticed that cache busting is not working this way. The serving and the concatenation is working fine, but I'm getting just app.js and not app.hash.js (and also for the css).
I ended up using Pathname.new(path).relative_path_from(Pathname.new(app.root)).to_s to relativize the absolute path from the root, but I think it should work this way.
The text was updated successfully, but these errors were encountered:
I have an app that uses absolute path (it loads some static files (css/js/fonts) from a gem) and noticed that cache busting is not working this way. The serving and the concatenation is working fine, but I'm getting just app.js and not app.hash.js (and also for the css).
I've traced back to: https://github.com/rstacruz/sinatra-assetpack/blob/master/lib/sinatra/assetpack/options.rb#L264 . Here the absolute path (local_path) is joined to the app root, effectively making /home/user/... to /home/user/.../home/user/... .
I ended up using Pathname.new(path).relative_path_from(Pathname.new(app.root)).to_s to relativize the absolute path from the root, but I think it should work this way.
The text was updated successfully, but these errors were encountered: