-1

My application has a Rating model and a Party model which belongs_to Rating.

When I create a new Rating, Rails renders a form to take the Rating name and than creates it, with no parties.

But I want Rating to have at least two parties, so when I create a new Rating, after submitting the name it should redirect to creating 2 parties.

Do not sure how to realize that, do you have some advice?

4

1 回答 1

0

Sounds like you probably want Nested Attributes with fields_for for the form. This will enable you to easily create your Party objects from your Rating controller.

于 2013-02-27T11:33:56.743 回答