Skip to content

Instantly share code, notes, and snippets.

@sharmaansh21
Last active December 28, 2015 12:59
Show Gist options
  • Select an option

  • Save sharmaansh21/7504620 to your computer and use it in GitHub Desktop.

Select an option

Save sharmaansh21/7504620 to your computer and use it in GitHub Desktop.
carrierwave with fog
CarrierWave.configure do |config|
if Rails.env.development? || Rails.env.test?
config.storage = :file
else
config.storage = :fog
config.fog_credentials = {
:provider => 'AWS', # required
:aws_access_key_id => Settings.amazon.access_key_id, # required
:aws_secret_access_key => Settings.amazon.secret_access_key, # required
:region => Settings.amazon.region # optional, defaults to 'us-east-1'
}
config.fog_directory = Settings.amazon.bucket # required
config.fog_public = true # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment