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|
%>
<p>
image description: <%= photo_form.text_field :description %>
<%= photo_form.file_field :image %>
</p>
<% end %>
<% end %>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.