sbaron24 said over 3 years ago on Nested Forms from Scratch :
Hello, thanks for the video!  Great step-by-step walkthrough. Everything worked for me except for line 4 in link_to_add_row;  it seems that this does not generate a new id each time I click the add row link in the UI;  it generates the same link each time and thus when I add a bunch of rows and submit the form, the controller receives the data from the last row (not all the rows).  Are you getting the same results?  Am I missing something?  Otherwise, do you have any workarounds if you're having the same issue?   My current workaround is kind of hacky and outside the context of your approach, which is changing the id in the DOM manually (using js or jquery) within the listener on ".fields" every time the link is clicked.