我有一個運行ActiveAdmin並使用CarrierWave上傳圖片的ROR應用程序。我有一個模型:產品,它允許多個ProductImages。在添加新產品並選擇幾張圖片上傳時,所有這些似乎都很順利。但是,一旦我想修改該產品的形象似乎並沒有真正被上傳,再加上我得到以下錯誤:ROR + ActiveAdmin + Carrierwave,上傳多張圖片後編輯
我的假設是,最初上傳並沒有做太多和爲此結束了空在編輯上。
這裏是管理形式的一個片段:
ActiveAdmin.register Product do
form(:html => {:multipart => true}) do |f|
f.inputs "Details" do
f.input :name
f.input :descr, :label => "Description"
f.input :brand, :as => :select, :collection => Brand.all, :member_label => :name, :label => "Brand"
# tags
f.autocomplete_field :tag_list, '/products/autocomplete_tag_name', :"data-delimiter" => ', '
f.input :tag_list, :hint => "Comma delimited tags"
end
f.has_many :product_images do |pi|
pi.inputs "Product Images" do
if !pi.object.nil?
pi.input :_destroy, :as => :boolean, :label => 'Destroy?'
end
pi.input :image_name
pi.input :image
end
end
f.buttons
end
end
編輯
我知道一兩件事,圖像做得到上載創作的帖子,其從編輯行爲up ..
我目前有同樣的問題 - 你找到任何解決方案嗎? :/ – mrmnmly
同樣的問題...不能刪除後添加..任何運氣? – Danpe