Ask A Question

Notifications

You’re not receiving notifications from this thread.

S3 Storage and Active Storage Images not showing

Rob Thomas asked in Rails

Hey Guys,

I have S3 Storage all setup and things are workin as I am getting:

ActiveStorage::Blob Update (0.8ms)  UPDATE "active_storage_blobs" SET "metadata" = $1 WHERE "active_storage_blobs"."id" = $2 

in the terminal but my images are shouwing as broken images. Any ideas on how to fix this?

Reply

Could you share the code?

Reply

Did you figure this out? I'm having trouble setting up S3 to work with Active Storage on a Heroku environment.

Would you mind sharing your setup, please?

Reply

Check if you have rescue from routing error in your routes.rb

Something like this:

Rails.application.routes.draw do
match '*unmatched', to: 'application#route_not_found', via: :all
end

That prevents active storage path from accessing your stored image in S3, hence the broken image.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,677+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.