1
Carrierwave에 대한 다중 업로드를 양식에 추가하려고하지만 하나의 모델 (게시물)에 두 개의 컨트롤러 (admin_posts 및 posts)가 있습니다. 이렇게 지정하는 방법을 모르겠습니다.헬퍼 (Carrierwave)를 구성하기 위해 멀티 파트를 추가하는 방법
_form.html.haml
= form_for [:admin, @post] do |f|
= f.fields_for :photos do |photo_fields|
= photo_fields.file_field :image
= f.text_field :title, class: "form-control", placeholder: "Title"
= f.text_area :body, rows: 12, class: "form-control", placeholder: "Body"
.pull-right
= f.submit "Send", class: "btn btn-success"
어떻게 해결?
미안 내 영어
당신이 사용할 수있는': HTML => {:에 enctype => "다중/폼 데이터"} form_for –
에서'감사합니다,하지만 작동하지 않습니다. – vveare138