Can i put more than one image on paperclip model? and how should i put it ?
rails g migration add_image_to_model_name
def self.down remove_attachment :model_name, :image, :image2 enddef self.up remove_attachment :model_name, :image, :image2 end
end
Best way is to create new table for paperclip attachments and setup
has-many
association between this table and your parent/existing table.With this approach, you can upload images as many you need.
Create
picture
model and migration file, then define paperclip'shas_attached_file
inpicture
model.Here is a tutorial you can refer to: Adding multiple images to a Rails model with paperclip