Skip to content

Commit 7fda688

Browse files
author
Kevin Rood
committed
Resolves issue ryanb#124
ryanb#124
1 parent 57f3278 commit 7fda688

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/generators/nested_form/templates/jquery_nested_form.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jQuery(function($) {
1313
// or for an edit form:
1414
// project[tasks_attributes][0][assignments_attributes][1]
1515
if(context) {
16-
var parent_names = context.match(/[a-z_]+_attributes/g) || [];
16+
var parent_names = context.match(/[a-z_]+_attributes(?=\]\[(new_)?\d+\])/g) || [];
1717
var parent_ids = context.match(/(new_)?[0-9]+/g) || [];
1818

1919
for(var i = 0; i < parent_names.length; i++) {

0 commit comments

Comments
 (0)