We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Fork of giraffesoft/attribute_fu
Description: rails multi-model forms made easy!
Homepage: http://jamesgolick.com/attribute_fu
Clone URL: git://github.com/cjkihlbom/attribute_fu.git

Comments for cjkihlbom's attribute_fu   feed

cjkihlbom commented on cjkihlbom/attribute_fu Thu Aug 28 22:19:48 -0700 2008
Comment in 9e8e07b:

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.

cjkihlbom commented on cjkihlbom/attribute_fu Thu Aug 28 22:18:59 -0700 2008

The comment has since been removed.

cmanfu commented on cjkihlbom/attribute_fu Thu Aug 28 16:11:10 -0700 2008
Comment in 9e8e07b:

cjkihlbom, can you explain exactly what is happening in this commit? I’m fairly sure this is doing what I’m trying to get from attribute_fu, which is to create unique identifiers for elements in partials brought in from the add_associated_link. I just can’t figure out how to get that unique id.