cjkihlbom

Carl-Johan Kihlbom
Newcode, Rails Mentor
Göteborg, Sweden
1
2

Following

Public Activity  feed

cjkihlbom started watching openid-rails-kit about 1 month ago
openid-rails-kit is at stympy/openid-rails-kit
cjkihlbom started watching flash-message-conductor about 1 month ago
flash-message-conductor is at planetargon/flash-message-conductor
cjkihlbom commented on cjkihlbom/attribute_fu about 1 month ago
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 about 1 month ago

The comment has since been removed.

cjkihlbom updated gist: 7728 about 1 month ago
def has_children? self.class.reflect_on_all_associations(:has_many).map { |a| !send(a.name).empty? }.any? end
cjkihlbom created gist: 7728 about 1 month ago
def has_children? self.class.reflect_on_all_associations(:has_many).map { |association| !send(association.name).empty? }.any? end
cjkihlbom started watching copy-as-rtf-tmbundle about 1 month ago
copy-as-rtf-tmbundle is at drnic/copy-as-rtf-tmbundle
cjkihlbom committed to cjkihlbom/attribute_fu about 1 month ago

9e8e07b21cdbe0b029bdca5c54373a95582c0d85

Fixed add_associated_link helper so that it produces unique IDs for the fields

cjkihlbom forked attribute_fu about 1 month ago
Forked repository is at cjkihlbom/attribute_fu
cjkihlbom started watching attribute_fu about 1 month ago
attribute_fu is at giraffesoft/attribute_fu