Created
December 5, 2013 16:08
-
-
Save mcconkiee/7808139 to your computer and use it in GitHub Desktop.
S3able intall and config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add to Gemfile | |
gem 's3able', path: '/Users/ericmcconkie/Desktop/s3uploadengine/s3able' | |
gem 'aws-sdk' | |
#mount to routes | |
mount S3able::Engine => '/images', :as => 's3image' #you can see all uploads at http://localhost:3000/images | |
get 'products/:id/image'=>'s3able/s3images#new', :s3imageable=>"Product" #a place to upload an image and attach to your model | |
#config | |
rake s3able:s3config secret="{{AWS_SECRET}}" key="{{AWS_KEY}}" bucket="{{aws_bucket}}" | |
#associate your model | |
class Product < ActiveRecord::Base | |
has_many :s3images, :as => :s3imageable, :dependent => :destroy ,:class_name => 'S3able::S3image' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment