Reputation: 1376
Active Storage image attachments disappears after some couple of minutes in production environment. I am able to upload the images, it appears for some minutes then disappears.
In local it says 'Image cannot be displayed because it contains error' and in Google Storage it says like 'The provided token has expired'.
I am using rail 5.2.3 and Ruby 2.6.0.
Upvotes: 1
Views: 567
Reputation: 346
Seems like you're using a temporary url, try using url_for
helper, it should give you a public permanent url.
https://edgeguides.rubyonrails.org/active_storage_overview.html#linking-to-files
Or rails_blob_url
for downloading and rails_representation_url
for attachment variants.
Upvotes: 1