I have an object that has multiple photos uploaded to it, using the
paperclip plugin. I used a virtual attribute to have mutliple photos
in the form but I can’t figure out how to get the image to save. It
works if I put <%= photo_form.file_field :image_file_name %> instead
of just :image. If I use just the following, the image_file_name
field is blank when it is saved.
<% for photo in @analysis.photos %>
<% fields_for “analysis[photo_attributes][]”, photo do |photo_form|
%>
image description: <%= photo_form.text_field :description %>
<%= photo_form.file_field :image %>
<% end %>
<% end %>