I have one model (Group) associated with my GroupController, but it has many instances of another model (People) in it. I want to be able to create new instances of People from my GroupController and add it to an array. What is the best way to go about doing this? The following is an excerpt from the GroupController:
class Group < Volt::ModelController
field :people_in_group
def add_people(name)
people_in_group = []
person = People.new(name)
people_in_group << person
end
end
The function breaks when I try to create a new person. Any advice?
Try something like this: