Skip to content
Browse files

Fixes issue in deeply nested fields where parent fields don't have in…

…puts or textareas

Closes #208
  • Loading branch information...
1 parent a6c3881 commit 104b45064b46b1b963d2dda283d49cdeaeb8d8be @eric88 eric88 committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 vendor/assets/javascripts/jquery_nested_form.js
View
2 vendor/assets/javascripts/jquery_nested_form.js
@@ -14,7 +14,7 @@ jQuery(function($) {
// Make the context correct by replacing <parents> with the generated ID
// of each of the parent objects
- var context = ($(link).closest('.fields').closestChild('input, textarea').eq(0).attr('name') || '').replace(new RegExp('\[[a-z_]+\]$'), '');
+ var context = ($(link).closest('.fields').closestChild('input, textarea, select').eq(0).attr('name') || '').replace(new RegExp('\[[a-z_]+\]$'), '');
// context will be something like this for a brand new form:
// project[tasks_attributes][1255929127459][assignments_attributes][1255929128105]

0 comments on commit 104b450

Please sign in to comment.
Something went wrong with that request. Please try again.