TODAY I LEARNED

StimulusReflex + ActiveStorage + Localhost

As it turns out, when you're working with StimulusReflex and ActiveStorage to store Images for a given model, you need to setup default_url_options in development.rb to

 config.action_controller.default_url_options ={ host: 'localhost', port: 3000 }

otherwise, they will be rendered with www.example.org/ host and won't show properly

Tweet

Learned by carlos-muniz on Mar 8, 2021

Discover our latest blog posts
  • #programming
  • view raw
  • permalink
  • 1 likes
previous TIL next TIL
  • Log in
  • ?

    TIL is an open-source project by MagmaLabs that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any MagmaLaber as well as selected friends of MagmaLabs. We hope you enjoy learning along with us.

    • /wearemagmalabs
  • statistics
  • search
  • Twitter