to account for @shekibobo nested use case, this should be
```coffeescript
index = parent.data('has_many_index') || parent.children('fieldset').length - 1
```