I often use form objects in some places in my application. But what I need now is something a little more complex.
When I create them, it's always an ActiveModel object with simple string attributes. But what I need now is for this object to have nested objects in them.
Ex: I have a ClassroomForm object, which has simple attributes such as name and teacher_id. But this Classroom object can have many student object, which has fields such as name and status.
What is the best way to do it using ActiveModel? Is the solution to create two form objects, ClassroomForm and StudentsForm, and then in ClassroomForm declare a attr_accessor :students ? But then how can I add new students in the form (using nested attributes)?