Adding new records to a form

Hi, I have a form that contains data for multiple records from a DB
table and that allows me to add new fields, corresponding to new DB
rows using a little ajax response to an "add item" link. Before I
added the ability to add new fields, my controller had something like