For some reason :child_index isn't working for me in rails 3.0.10. My code is also modified to allow reordering. I am also using formtastic 1.2.4 with haml, and have tried switching the semantic_fields_for to fields_for and have also tried with or without the new_object as an array as a previous commenter noted. Here is the code:
Figured it out, I was passing f instead of builder...
For some reason :child_index isn't working for me in rails 3.0.10. My code is also modified to allow reordering. I am also using formtastic 1.2.4 with haml, and have tried switching the semantic_fields_for to fields_for and have also tried with or without the new_object as an array as a previous commenter noted. Here is the code:
.field = f.semantic_fields_for :poll_answers, poll_answer do |builder| = builder.input :text = builder.hidden_field :position = builder.hidden_field :_destroy = link_to_function "Delete", "remove_fields(this)", :class => 'remove' %br