I am using ryan bates nested_form gem to dynamically add some nested field to the form.
eg.
<%= f.fields_for :phones do |phone_form| %> <%= phone_form.text_field :phone_number %> <% end %> <%= f.link_to_add "Add a phone", :phones %></p>
Everything works, except TWO empty fields are added every time a link is clicked.
I set a breakpoint on $('form a.add_nested_fields').live('click', function() and I see that it is called twice ...
I am using chrome on mac
source share