paperclip gem question.

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.

So do I have to change something or did I misunderstand the manual.

Roelof

Hi…

  1. in Gemfile add this gem

gem “paperclip”, “3.1.4”

  1. bundle install
    3.after creating model add below code in migration file(db->migrate->photo model migration file )

t.attachment:photo

  1. rake db:migrate

  2. in your model Add this code
    attr_accessible: photo

has_attached_file :photo
:path=>“rails_root/public/system/:attachment/:id/:style/:filename”,
:url=> “system/:attachment/:id/:style/:filename”