Paperclip plugin not working

I am trying to use the paperclip plugin to allow users to select an avatar, upload and store it. I can't seem to work.

I have created three fields:


    add_column :users, :avatar_file_name, :string
    add_column :users, :avatar_content_type, :string
    add_column :users, :avatar_file_size, :integer
    add_column :users, :avatar_updated_at, :datetime
      



I added the following to my user model:


has_attached_file :avatar, 
                    :styles => { :medium => "300x300>",
                                 :thumb => "100x100>" }
      



and added an input field to my custom form:

<%= form.file_field :avatar %>
      



and my controller works fine for any other field other than this, so I don't think that's the problem.

Any ideas?

(ps: I understand the downloaded code is missing, but the <code> tag removes them.)

0


a source to share


1 answer


": multipart => true" fixed it



Sorry I made a mistake and it was a simple solution.

0


a source







All Articles