rails version 5.2
I have a scenario that I need to access the public url of Rails Active Storage with Amazon s3 to make a zip file with Sidekiq bac
Use ActiveStorage::Blob#service_url. For example, assuming a Post model with a single attached header_image:
@post.header_image.service_url
Since Rails 6.1 ActiveStorage::Blob#service_url is deprecated in favor of ActiveStorage::Blob#url.
So, now
@post.header_image.url
is the way to go.
Sources: