【发布时间】:2016-04-13 18:30:07
【问题描述】:
我正在尝试上传多张图片,但在选择多张图片后重新归档仅创建一条记录。我已经从那里查看了 gorails refile 视频,他们通过将 image_id 添加到表中显示上传。 但是这里refile multiple file uploads
他们正在使用图像模型。
谁能帮我解决这个问题?
这是我的代码:
我的模型
class Photo < ActiveRecord::Base
acts_as_votable
attachment :image
has_many :users
has_many :images
end
我的控制器参数
def photo_params
params.require(:photo).permit(:photo_title, :photo_description,:photo_caption,
:image, :image_cache_id, :remove_image,)
end
照片表单视图
<%= f.attachment_field :image, direct: true, multiple: true %>
【问题讨论】: