Creating a set number of child objects from a parent's form
问题 Thanks to Ruby on Rails: How to gather values for child tables from a form? and "Agile Web Dev", I know how to have multiple models in a form using fields_for . But I'm tearing my hair out over this one. Suppose I have a model Person . Person has a name attribute, and has_many :foos . The Foo model, in turn, has a colour attribute. Furthermore, I know that each Person has precisely three Foos . What should my Models, the new and create actions in PersonController , and the new view look like