Adding dynamic fields to nested form through AJAX

前端 未结 2 733
野趣味
野趣味 2021-02-06 01:39

I\'ve been watching and reproducing these railscasts on my app: 196-nested-model-form-part-1 and 197-nested-model-form-part-2. I do not yet have a pro account so i can\'t watch

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-06 01:57

    I don't have a pro account on Railscasts either, but sometimes it is a good idea to have a look at Ryan's Github account. Oftentimes he develops gems to stuff he covered in his episodes. There you will find this awesome nested_form gem, which does exactly what you want.

    Of course you can reinvent the wheel, but I think it is much easier and faster to use Ryan's gem. The documentation explains perfectly how to use it. Have fun!

提交回复
热议问题