Skip to content

Instantly share code, notes, and snippets.

@lks128
Created December 25, 2012 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lks128/4373736 to your computer and use it in GitHub Desktop.
Save lks128/4373736 to your computer and use it in GitHub Desktop.
Paperclip Rails initializer to store data on the European S3 server using Fog.
# config/initializers/01_paperclip.rb
if Rails.env.production?
Paperclip::Attachment.default_options.merge!(
storage: :fog,
fog_directory: 'lazy-enterprise',
fog_host: 'https://s3-eu-west-1.amazonaws.com/lazy-enterprise',
fog_public: true,
fog_credentials: {
provider: 'AWS',
aws_access_key_id: ENV['S3_ID'],
aws_secret_access_key: ENV['S3_KEY'],
region: 'eu-west-1'
}
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment