开发者

Create multiple records in one form with one model - No not nested forms or anything

开发者 https://www.devze.com 2023-02-21 01:37 出处:网络
Hi I\'ve searched for a nice tut showing me how I can create multiple data into one single model with one form. I only find really advance nested forms with a lot of functionality that I believe I don

Hi I've searched for a nice tut showing me how I can create multiple data into one single model with one form. I only find really advance nested forms with a lot of functionality that I believe I don't need.

Can someone give me a direction on how to do this.

I have these two models. Products with many prices Prices that belongs to products

Now I want to do a form that can create prices for every product in one single actio开发者_Python百科n. Maybe there is a nice tutorial out there on this, but I can't find it...

Thanks in advance.


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消