Creating multiple records in one form with one model - No nested forms or anything else

Hi I was looking for a good tut showing me how I can create multiple data in the same model with one form. I only find really advanced nested forms with great functionality that I don't think I need.

Can someone give me directions on how to do this.

I have these two models. Products with many prices. Product related prices.

Now I want to create a form that can create prices for each product in one action. Maybe there is a good textbook there, but I can not find it ...

Thanks in advance.

+4
source share
1 answer

You want nested forms, although they don't have to be complicated.

See the corresponding Railscast for a great introduction to them. http://railscasts.com/episodes/196-nested-model-form-part-1

+3
source

Source: https://habr.com/ru/post/1345939/


All Articles