I am migrating from deprecated paperclip gem to ActiveStorage
and wondering how can I get hold of attachment URL in the model (for example if I want to add it to custom as_json
method, some elasticshearh data etc.)
Couldn't find anything in documentation for that particular use case.
file = fetch_your_file
link = rails_blob_path(file, disposition: 'attachment')
will return the attachment link