Skip to content

Instantly share code, notes, and snippets.

@stream7
Forked from serek/paperclip.rb
Created September 29, 2011 18:50
Show Gist options
  • Save stream7/1251576 to your computer and use it in GitHub Desktop.
Save stream7/1251576 to your computer and use it in GitHub Desktop.
Paperclip initializer for S3 Europe.
Paperclip.interpolates(:s3_eu_url) { |attachment, style|
"#{attachment.s3_protocol}://s3-eu-west-1.amazonaws.com/#{attachment.bucket_name}/#{attachment.path(style).gsub(%r{^/}, "")}"
}
require 'aws/s3'
AWS::S3::DEFAULT_HOST = "s3-eu-west-1.amazonaws.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment