ActiveAdmin has_many form not saved if parent model is new and is NOT NULL in child model
问题 I have two models, Room and Student . Room has_many Student s. Student belongs_to Room . I got an error Room can't be blank when I try to add Student to Room during creating a new Room. My guess is that, upon submission, child object (student) is saved before parent object (room) is saved. Is there a way to bypass the order without remove the NOT NULL setting on room_id? Or my guess is wrong? Or even worse, I am doing it wrong? # app/models/room.rb class Room < ActiveRecord::Base validates