The model has accepts_nested_attributes_for for the relationship, and the form is as follows:
= semantic_form_for @obj, :url => path do |f|
= f.inputs do
= f.input :name
= f.semantic_fields_for :photos do |p|
= p.inputs :desc
= f.buttons
The form works well and everything is in order. However, I would like to display each photo next to the field, so the user could imagine which photo she would comment on. In any case, to access photos.id inside the fields_for loop?
Edit:
Is there a way to change the display order of the photo fields in this example. As far as I can tell so far, this order is rather random.
source
share