Paperclip gem question


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

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.



  1. in Gemfile add this gem

gem “paperclip”, “3.1.4”

  1. bundle install
    3.after creating model add below code in migration
    model migration file )


  1. rake db:migrate

  2. in your model Add this code
    attr_accessible: photo

has_attached_file :photo
:url=> “system/:attachment/:id/:style/:filename”

On Sat, Oct 6, 2012 at 9:10 PM, roelof [email protected] wrote:

You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
To view this discussion on the web visit
For more options, visit

కొంచం తపన,
కాస్త ఆసక్తి,
కొన్ని కలలు,
కాసిన్ని ఊహలు కలిపేస్తే

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs