ActiveAdmin in Rails implements a form method for an object with has_many relationship, but the error 'undefined method 'new_record?' for nil:NilClass' occurs.
A has_many B A has_many C
In a relationship, I want to edit B and C together while editing A.
B works well, but C doesn't...
(Actually, I found the answer, but I left it on the record because I shoveled too much yesterday.)
ruby-on-rails activeadmin
There was an answer to that. I should've searched it earlier.
A was defined with accept_nested_attributes_for B A does not have accept_nested_attributes_for C defined.
It works well if you define this only in the original model file (not in the admin folder).
© 2024 OneMinuteCode. All rights reserved.