Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Resolved Issue #122 #123

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/generators/nested_form/templates/jquery_nested_form.js
Expand Up @@ -6,7 +6,7 @@ jQuery(function($) {

// Make the context correct by replacing new_<parents> with the generated ID
// of each of the parent objects
var context = ($(this).closest('.fields').find('input:first').attr('name') || '').replace(new RegExp('\[[a-z]+\]$'), '');
var context = ($(this).closest('.fields').find('input:first').attr('name') || '').replace(new RegExp('\[[a-z_]+\]$'), '');

// context will be something like this for a brand new form:
// project[tasks_attributes][new_1255929127459][assignments_attributes][new_1255929128105]
Expand Down