Skip to content

Instantly share code, notes, and snippets.

@BDQ
Created December 9, 2011 13:56
Show Gist options
  • Save BDQ/1451618 to your computer and use it in GitHub Desktop.
Save BDQ/1451618 to your computer and use it in GitHub Desktop.
S3_CREDENTIALS = {:access_key_id => ENV['S3_KEY'], :secret_access_key => ENV['S3_SECRET'], :bucket => ENV['S3_BUCKET']}
Image.class_eval do
Image.attachment_definitions[:attachment].tap do |a|
a[:styles][:large] = '600x350>'
a[:styles][:small] = '260x170>'
a[:styles][:mini] = '60x60#'
a[:styles][:square] = '78x78#'
a[:storage] = :s3
a[:s3_credentials] = S3_CREDENTIALS
a[:path] = "products/:id/:style/:basename.:extension"
a[:url] = ":s3_domain_url"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment