1
我想用多态关联和神社实现多个文件上传。Rails 5 +神殿多个文件上传
class Campaign < ApplicationRecord
has_many :photos, as: :imageable, dependent: :destroy
accepts_nested_attributes_for :photos, allow_destroy: true
end
class Photo < ApplicationRecord
include ImageUploader::Attachment.new(:image)
belongs_to :imageable, polymorphic: true
end
我可以在浏览文档后保存照片。
请指教如何验证可成像范围内图像的唯一性。
我知道每个原始版本都可以生成签名,但这是否正确?
谢谢。
谢谢!我计算了最后一天使用jQuery进行直接上传。 :) – Anton