Reputation: 16749
I'm looking for a easy way to have multiple attachments on one model using Rails Admin. I've already Paperclip working, but I need multiple images and not just one.
Any hints / ideas / links?
Thank you very much!
Ole
Upvotes: 1
Views: 3368
Reputation: 40277
Let's say that you have a user who wants many photos:
class User
has_many :photos
end
class Photo
belongs_to :user
has_attached_file :image
#or
mount :image, ImageUploader
end
So you don't ask your carrierwave or paperclip model to have multiple files, you instead have many paperclip models belonging to your rails model.
Upvotes: 7