All threads / How can I display production s3 images in staging?

Ask A Question


You’re not receiving notifications from this thread.

How can I display production s3 images in staging?

Michael Prince asked in General

I have one s3 bucket for production and one for staging. What I want to be able to do is display production images when on staging (or development), but if I update an image while on staging/development have that not affect production. That way I can pull a copy of my production db and load it to staging and have staging not full of broken images.

I came across this article for migrating from Paperclip which had an interesting idea to achieve this, but it's not fleshed out enough for me to follow. Any help would be appreciated.

What I do is copy the production bucket to the staging bucket from time to time.
Have a simple Ruby script to do this.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.