I’m using Rails 3.2, Carrierwave and simple_form.
Currently, everything is working fine with one image upload with the following code:
<% @product.images.build if @product.images.blank? %>
<%= f.simple_fields_for :images do |img| %>
<% unless @product.images.first.file.blank? %>
<div class="control-group">
<label class="controls"><%= image_tag @product.images.first.file %></label>
</div>
<%= img.input :_destroy, :label => "Remove", :as => :boolean %>
<% end %>
<%= img.input :file, :as => :file, :label => "Picture", input_html: { class: "input-hundredpercent" } %>
<% end %>
However, how can I turn this nested form for multi image upload?
You could try Ryan Bate’s nested_form gem (https://github.com/ryanb/nested_form).
Also refer to his railscast about this topic: http://railscasts.com/episodes/196-nested-model-form-revised