Skip to content

Instantly share code, notes, and snippets.

@schleg
Created November 29, 2011 05:03
Show Gist options
  • Save schleg/1403514 to your computer and use it in GitHub Desktop.
Save schleg/1403514 to your computer and use it in GitHub Desktop.
# config/amazon_s3.yml
development:
access_key_id: <access key>
secret_access_key: <secret>
test:
access_key_id: ...
secret_access_key: ...
production:
access_key_id: ...
secret_access_key: ...
# app/models/<Your Model>.rb
has_attached_file :<the_image_attribute_name>, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :storage => :s3, :path => ":attachment/:id/:style.:extension", :bucket => '<your_image_bucket>', :s3_credentials => "#{::Rails.root.to_s}/config/amazon_s3.yml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment