From reading the documentation I understand this might be doable, but I don't know how!
For the production environment I have three buckets (three models, three buckets) image-bucket, audio-bucket, pdf-bucket, but for the development environment,开发者_如何学Go I want to have dev-image-bucket, dev-audio-bucket, dev-pdf-bucket.
How do I set the proc? Do I set up multiple configuration files, example code would be greatly appreciated.
No need for a proc. In your model:
has_attached_file :image,
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:path => "whatever",
:bucket => "#{Rails.env}-image-bucket"
Nah, this is what I was looking for
:bucket => lambda { |photo| "#{(Rails.env.development? ? 'dev-' : '' )}feature-photos" }
精彩评论