문제

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