We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57f3278 commit 7fda688Copy full SHA for 7fda688
lib/generators/nested_form/templates/jquery_nested_form.js
@@ -13,7 +13,7 @@ jQuery(function($) {
13
// or for an edit form:
14
// project[tasks_attributes][0][assignments_attributes][1]
15
if(context) {
16
- var parent_names = context.match(/[a-z_]+_attributes/g) || [];
+ var parent_names = context.match(/[a-z_]+_attributes(?=\]\[(new_)?\d+\])/g) || [];
17
var parent_ids = context.match(/(new_)?[0-9]+/g) || [];
18
19
for(var i = 0; i < parent_names.length; i++) {
0 commit comments