I thought this would be fairly simple, but can’t seem to figure out how to do it.
I’m storing some images in s3, and want to have a different bucket as per if the items are being saved during development, testing, or production.
So, I thought I’d be able to say
:storage => :s3,
:s3_credentials => ":rails_root/config/s3.yml",
:url => '/activities/:id/:style.:extension',
:path => 'activities/:id/:style.:extension',
:bucket => 'appName_:envirnment'
of course, I can’t seem to find how to say :environment. This must be available as a variable somewhere, isn’t it?
It should work normally by just including
#{Rails.env}directly in the :url and :path values. For development and testing the url and path values are loaded each time the class is loaded and in production they’re loaded on boot. So just include it and it should work: