Skip to content

Instantly share code, notes, and snippets.

@maxim
Created October 3, 2012 02:36
Show Gist options
  • Select an option

  • Save maxim/3824613 to your computer and use it in GitHub Desktop.

Select an option

Save maxim/3824613 to your computer and use it in GitHub Desktop.
EU West S3 with paperclip
# 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