我有一个事件模型,其中包含许多图像字段
class Event < ApplicationRecord
has_one_attached :poster
has_one_attached :ticket_image
has_many_attached :images
end
如何在上述字段的活动管理事件仪表板上创建和允许图像?我使用active_storage作为我的图像上传器
尝试这样的事情:
ActiveAdmin.register Event do
...
form do |f|
input :poster, as: :file
input :ticket_image, as: :file
input :images, as: :file, input_html: { multiple: true }
end
permit_params :poster, :ticket_image, images: []
end