ruby on rails - ActiveAdmin + Carrierwave + Multiple Image Upload -
i'm using rails 5 , cannot find solution upload multiple images when using activeadmin
. code below. appreciate
i keep getting message in logs , images won't upload: unpermitted parameter: pic_attachments
activeadmin.register art permit_params :name, picture: [] form html: { multipart: true } |f| f.semantic_errors *f.object.errors.keys f.file_field :picture, multiple: true, required: true, name: "pic_attachments[picture][]" f.actions end end
models:
class art < applicationrecord mount_uploader :picture, pictureuploader has_many :pic_attachments, dependent: :destroy accepts_nested_attributes_for :pic_attachments end class picattachment < applicationrecord mount_uploader :picture, pictureuploader belongs_to :art validates_associated :art end
Comments
Post a Comment