Skip to content

Instantly share code, notes, and snippets.

@safarista
Last active December 16, 2015 05:29
Show Gist options
  • Save safarista/5384789 to your computer and use it in GitHub Desktop.
Save safarista/5384789 to your computer and use it in GitHub Desktop.
Spree heroku paperclip configs
#initializers/spree.rb
Spree.config do |config|
# Example:
# Uncomment to override the default site name.
config.site_name = "Coffee Tailors"
# Amazon S3 Storage
config.use_s3 = false # if Rails.env.production?
config.s3_bucket = 'spree'
config.s3_access_key = "WTERTRTRYRYEYEU"
config.s3_secret = "HHJGHKIYIYKHGUOHIHOUFDYFUDIHD:IUF:HJF:HLJHJL"
config.attachment_url = ":s3_eu_url"
config.s3_host_alias = "seu-west-1.amazonaws.com"
end
Spree.user_class = "Spree::User"
if Rails.env.production?
Paperclip.interpolates(:s3_eu_url) do |attachment, style|
"#{attachment.s3_protocol}://#{Spree::Config[:s3_host_alias]}/#{attachment.bucket_name}/#{attachment.path(style).gsub(%r{^/}, "")}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment