Skip to content

Instantly share code, notes, and snippets.

@peterberkenbosch
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterberkenbosch/9192273 to your computer and use it in GitHub Desktop.
Save peterberkenbosch/9192273 to your computer and use it in GitHub Desktop.
s3_host_alias = "s3-ap-southeast-2.amazonaws.com"
Spree::Image.attachment_definitions[:attachment][:url] = s3_host_alias
Spree::Image.attachment_definitions[:attachment][:path] = '/spree/products/:id/:style/:basename.:extension'
Spree::Image.attachment_definitions[:attachment][:storage] = :s3
Spree::Image.attachment_definitions[:attachment][:bucket] = ENV['s3_bucket']
Spree::Image.attachment_definitions[:attachment][:s3_credentials]= {
:access_key_id => ENV['s3_access_key_id'],
:secret_access_key => ENV['s3_secret_access_key']
}
Paperclip::Attachment.default_options[:storage] = :s3
Paperclip::Attachment.default_options[:bucket] = ENV['s3_bucket']
Paperclip::Attachment.default_options[:s3_credentials] = {
:access_key_id => ENV['s3_access_key_id'],
:secret_access_key => ENV['s3_secret_access_key']
}
Paperclip::Attachment.default_options[:s3_host_name] = s3_host_alias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment