Skip to content

Instantly share code, notes, and snippets.

@andrewtimberlake
Created January 2, 2009 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save andrewtimberlake/42525 to your computer and use it in GitHub Desktop.
Save andrewtimberlake/42525 to your computer and use it in GitHub Desktop.
- has_attachment :content_type => :image,
- :thumbnails => {
- :thumb => [80,80],
- :small => '320x320>'
- },
- :storage => :s3,
- :s3_access => :private
+
+ has_attached_file :photo,
+ :styles => {
+ :thumb => ["80x80#", :jpg],
+ :small => ["320x320>", :jpg]
+ },
+ :storage => :s3,
+ :s3_credentials => "#{RAILS_ROOT}/config/amazon_s3.yml",
+ :s3_permissions => 'private',
+ :path => ":id/:style.:extension",
+ :bucket => "#{RAILS_ENV == 'production' ? 'photos' : 'backup'}_bucket"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment