سؤال

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

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top