diff --git a/lib/administrate/field/nested_has_many.rb b/lib/administrate/field/nested_has_many.rb index 5cfd3ee..6c1c962 100644 --- a/lib/administrate/field/nested_has_many.rb +++ b/lib/administrate/field/nested_has_many.rb @@ -39,7 +39,7 @@ def nested_fields_for_builder(form_builder) next if nested_field.resource.blank? # inject current data into field - resource = data[form_builder.index] + resource = form_builder.object nested_field.instance_variable_set( "@data", resource.send(nested_field.attribute),