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
This is still prevalent in rails 7.1.0.alpha and is not just related to active storage. It also redirects to the wrong URL for JS and CSS if I override the config.
Started GET "/anything/assets/application-5b98c5413b25e84aff009af9d2ca59257596e92d67359343c32a2a3514453b29.css"for 127.0.0.1 at 2021-12-11 12:02:54 +0530
Started GET "/anything/assets/es-module-shims.min-5bee6b190e63d2c7cb18661d714ede9c7ab8ce0b4b3e5cc34092e05ef6046ebd.js"for 127.0.0.1 at 2021-12-11 12:02:54 +0530
ActionController::RoutingError (No route matches [GET] "/anything/assets/es-module-shims.min-5bee6b190e63d2c7cb18661d714ede9c7ab8ce0b4b3e5cc34092e05ef6046ebd.js"):
ActionController::RoutingError (No route matches [GET] "/anything/assets/application-5b98c5413b25e84aff009af9d2ca59257596e92d67359343c32a2a3514453b29.css"):
Started GET "/anything/assets/image-3b62fb9bcec45d4a137737f821fb5db5c6f42b7d1dd01ffb3ba6a066bda87cc8.jpg"for 127.0.0.1 at 2021-12-11 12:02:54 +0530
ActionController::RoutingError (No route matches [GET] "/anything/assets/image-3b62fb9bcec45d4a137737f821fb5db5c6f42b7d1dd01ffb3ba6a066bda87cc8.jpg"):
As defined here, it uses the ENV["RAILS_RELATIVE_URL_ROOT"] to set the relative_url_root. So I think you need to do the same instead of overriding it in the config. You can also check this guide.
Bug
If you have configured a relative root url, the active storage service will redirect wrong.
Example:
Steps to reproduce
Add to config:
config.relative_url_root = '/anything'
In your view:
image_tag(record.image)
System configuration
Rails version: 6.1.0
Ruby version: ruby 2.7.1p83
The text was updated successfully, but these errors were encountered: