We use Formtastic and built add_fields / remove_fields for one to many association models based on this railscasts. Now we are encountering a duplicate entries problem. Say, after we create a new project, and then edit this project with 3 tasks loaded, if I add one more task when editing, this new added task is duplicated in database.
We also use update_attributes to check validation and AJAX to submit the form and run the process in the background job in sidekiq.
And I found this link, but I'm using rails 3.2. Not sure what I can do for this case...
Has anyone met this problem before? I'm now trying to post my codes here.(too complicated to simplify posting here hehe)
UPDATE So after a long investigation of this problem, we found the double entry is caused by submitting AJAX twice.