Created
September 17, 2016 00:45
-
-
Save normancapule/0472657fef61bc8285aa40d81c690c75 to your computer and use it in GitHub Desktop.
Paperclip AWS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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