Sure, here’s the gist of it:
The problem:
fields_for sanitizes object names when generating IDs. 'project[todo_attributes][new][#{number}]' becomes 'project_todo_attributes__new_____number_', causing the Template, which looks for the string '#{number}' to not replace the number in the ID with the variable count. That means that all associated fields generated by clicking the link will have the same IDs.
The fix (hack):
gsub the '__number_' with the variable count after the Template evaluation. Not the cleanest solution, but it works.