Skip to content

Instantly share code, notes, and snippets.

@icebreaker
Created September 30, 2011 08:15
Show Gist options
  • Save icebreaker/1253061 to your computer and use it in GitHub Desktop.
Save icebreaker/1253061 to your computer and use it in GitHub Desktop.
Carrierwave initializer
CarrierWave.configure do |config|
if Rails.env.development?
config.storage = :file
else
config.storage = :s3
config.s3_access_policy = :public_read
config.s3_access_key_id = 'ACCESS_KEY'
config.s3_secret_access_key = 'SECRET_ACCESS_KEY'
config.s3_headers =
{
'Cache-Control' => 'public; max-age=604800', # 1 week
'Expires' => 1.week.from_now.httpdate
}
config.s3_bucket = 'bucket-name'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment