engine/lib/generators/locomotive/install/templates/carrierwave.rb

28 lines
747 B
Ruby
Raw Normal View History

2011-04-06 23:34:36 +00:00
CarrierWave.configure do |config|
config.cache_dir = File.join(Rails.root, 'tmp', 'uploads')
case Rails.env.to_sym
when :development
config.storage = :file
config.root = File.join(Rails.root, 'public')
when :production
# the following configuration works for Amazon S3
config.storage = :fog
config.fog_credentials = {
:provider => 'AWS',
:aws_access_key_id => ENV['S3_KEY_ID'],
:aws_secret_access_key => ENV['S3_SECRET_KEY'],
:region => 'us-east-1'
}
config.fog_directory = ENV['S3_BUCKET']
else
# settings for the local filesystem
config.storage = :file
config.root = File.join(Rails.root, 'public')
2011-04-06 23:34:36 +00:00
end
end