Skip to content

Instantly share code, notes, and snippets.

@normancapule
Created September 17, 2016 00:45
Show Gist options
  • Save normancapule/0472657fef61bc8285aa40d81c690c75 to your computer and use it in GitHub Desktop.
Save normancapule/0472657fef61bc8285aa40d81c690c75 to your computer and use it in GitHub Desktop.
Paperclip AWS
Paperclip::Attachment.default_options[:url] = ':s3_domain_url'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
Paperclip::Attachment.default_options[:s3_host_name] = 's3.amazonaws.com'
config.paperclip_defaults = {
storage: :s3,
s3_credentials: {
bucket: ENV.fetch('S3_BUCKET_NAME'),
access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
:s3_region => ENV['AWS_REGION']
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment