Hi...
1. in Gemfile add this gem
gem "paperclip", "3.1.4"
2. bundle install
3.after creating model add below code in migration file(db->migrate->photo
model migration file )
t.attachment:photo
4. rake db:migrate
5. in your model Add this code
attr_accessible: photo
has_attached_file :photo
Hello,
I decided that I use paperclip to handle my images.
I have this model for posts
class Micropost < ActiveRecord::Base
attr_accessible :content, :user_id
belongs_to :user
end
So according to the manual I have to do this :
has_attached_file :photo
But :photo is never used anywhere.
2 matches
Mail list logo