I want to upload images on my local machine for development but store them on my Amazon S3 account for production.
upload.rb
if Rails.env.development?
Why not modify paperclip default options in production.rb?
Add this to config/environments/production.rb:
Paperclip::Attachment.default_options.merge!({
:storage => :s3,
:bucket => 'bucketname',
:s3_credentials => {
:access_key_id => ENV['S3_ACCESS_KEY'],
:secret_access_key => ENV['S3_SECRET_KEY']
}
})