I am on:
Rails: 6.0.1
Ruby: 2.6.5
And I am using Rails.application.routes.url_helpers.rails_blob_path helper in one of my serializers to generate path to a pdf file. And it has been working great in development. Generating url like:
/rails/active_storage/blobs/:signed_id/*filename
as expected.
But in production, same helper produces wrong url in the format of:
/active_storage/blobs/:signed_id/*filename
notice the missing /rails part in start.
This obviously causes no route matches errors when the url is accessed.
I have been trying to dig and find cuase, temporarily i have added following to my routes.rb
get '/active_storage/blobs/:signed_id/*filename', to: 'active_storage/blobs#show'
I know this is just a hack, but it works for now. I am looking for the real reason and fix through this question.