Skip to content

Instantly share code, notes, and snippets.

@serek
Created April 19, 2011 15:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save serek/928462 to your computer and use it in GitHub Desktop.
Save serek/928462 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.replace "s3-eu-west-1.amazonaws.com"
@mmarschall
Copy link

To avoid the warning on server startup you can use:

AWS::S3::DEFAULT_HOST.replace "s3-eu-west-1.amazonaws.com"

@serek
Copy link
Author

serek commented Oct 20, 2011

Actually I had it in my initializer file but forgot to update it here.

Thanks mmarschall!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment