Count the number of elements in a jQuery nested attributes container
To count the number of elements that is in a jQuery nested attributes container we can extend the plugin to have the following method (coffeescript):
You would put that in the actual jquery.nested_attributes.coffee file. Then you can call:
- Update: this has been accepted to the core plugin so it’s no longer needed.