Skip to content

Commit d41a210

Browse files
committed
Fix issue with has_many nested_input
The JS here is now scoping down the selector to the containing fieldset, rather than the whole document
1 parent 00fb5fd commit d41a210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/javascript/activeadmin_addons/inputs/nested-select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ var initializer = function() {
155155
if (!!parent) {
156156
var parentSelectorId = '#' + model + '_' + parent;
157157
if (!$(parentSelectorId).length) {
158-
parentSelectorId = $(container).find('*[id*=' + parent + ']')[0];
158+
parentSelectorId = selectInstance.closest("fieldset.inputs").find("*[id*=" + parent + "]")[0];
159159
}
160160
var parentSelector = $(parentSelectorId)[0];
161161

0 commit comments

Comments
 (0)