Topic: Editing child fields lost on upgrade to rails 3.2.2 [SOLVED]
Recently I upgraded from rails 3.0.7 to rails 3.2.2
Now my form, which uses accepts_nested_attributes_for to edit multiple child records, no longer works.
In my models I use belongs_to, has_many and accepts_nested_attributes_for to set up the parent-child relationships.
In my form I use form_for initially, then fields_for to generate the child fields in the form:
<%= form_for(@tc_employee) do |f| %>
.... stuff here ...., then I use a loop to create a set of text boxes for each child record:
<% i = 0 %>
<% f.fields_for :TcDatum do |pf| %>
<%= pf.hidden_field :d1 %>
... more hidden fields here .... then:
<%= pf.text_field :total_hours, :size => 4, :onclick => blah blah ... %>
<%= pf.label :total_hours, pf.object.label_text, :style .... %>
<% i = i + 1 %>
<% end %>
....etc to the end of the form..
For some reason, none of the fields in the fields_for section are generated, neither the hidden fields nor the total_hours field or it's label. They are created in the rails 3.0.7 installation but not on the server upgraded to rails 3.2.2.
Any ideas how to get my fields_for child fields back?
Thanks for any help. --Fred
p.s. do the site managers know that half the time I submit a question, using 'preview' first, a lot of the text of my post is lost?
Last edited by fredrated (2012-05-31 12:36:45)