Created
October 3, 2012 02:36
-
-
Save maxim/3824613 to your computer and use it in GitHub Desktop.
EU West S3 with paperclip
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
| # Something like this in initializer | |
| Paperclip.interpolates(:s3_eu_url) { |attachment, style| | |
| "#{attachment.s3_protocol}://s3-eu-west-1.amazonaws.com/#{attachment.bucket_name}/#{attachment.path(style).gsub(%r{^/}, "")}" | |
| } | |
| # And then this in attachment options | |
| url: ':s3_eu_url', | |
| storage: :s3, | |
| s3_credentials: YOUR_CREDS, | |
| s3_headers: { 'Expires' => 1.year.from_now.httpdate }, | |
| bucket: 'your_bucket' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment