我想使用Carrierwave和Dropzone.js上傳多個圖像,但是當我提交表單時出現以下錯誤。Carrierwave,Dropzone.js Rails 4,強大的參數
請注意,沒有dropzone.js的表單工作正常,這意味着當我只是使用HTML5上傳多個圖像。
請參考下面當I(使用懸浮窗通過AJAX)提交表單其中創建哈希
「project_images_attributes」=> [{ 「圖像」=
[#,@ original_filename =「artist4.jpg」,@ content_type =「image/jpeg」,@ headers =「Content-Disposition:form-data; name = \」project [project_ images_attributes] [] [image] [] \「; filename = \「artist4.jpg \」\ r \ nContent-Type:image/jpeg \ r \ n「>,#,@ original_filename =」feed1.jpg「,@con tent_type =」image/jpeg「, @ headers =「Content-Disposition:form-data;名= \ 「項目[project_images_attributes] [] [圖像] [] \」; filename = \「feed1.jpg \」\ r \ nContent-Type:image/jpeg \ r \ n「>,#,@ original_filename =」gallery1.jpg「,@ content_type =」image/jpeg「,@ headers = 「Content-Disposition: form-data;名= \ 「項目[project_images_attributes] [] [圖像] [] \」; filename = \「gallery1.jpg \」\ r \ nContent-Type:image/jpeg \ r \ n「>]}]},」project-vide o「=> [」「],」commit「=>創建項目「}
不允許的參數:圖像
請注意我已經列入白名單在我的控制器的圖像PARAMS也它的工作使用HTML 5,但不使用Ajax和dropzone.js
有沒有人知道如何解決這個問題?
謝謝
從您將屬性列入白名單的控制器共享相關代碼。 –