包含嵌套表单的深层嵌套表单 [英] Deeply nested form containing a nested form

查看:99
本文介绍了包含嵌套表单的深层嵌套表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了使用深层嵌套表格进行调查的障碍:
http://railscasts.com/episodes/196-nested-model -form-revised?view = asciicast

I saw the railscast on using deeply nested forms to make a survey:
http://railscasts.com/episodes/196-nested-model-form-revised?view=asciicast

您将如何在Rails中构造与实际/接受/调查类似的内容,而不仅仅是构造它以文本形式显示?您将如何制作一个深层嵌套的表单,其中包含用户填写的调查表?

How would you construct something similar in Rails to actually /take/ the survey, instead of just construct it for display in text? How would you make a deeply nested form containing a survey form the user fills out?

推荐答案

结合考虑的因素: 使用fields_for(这是构造子窗体). 使用nested_form继续构建子表单(n个数量)- https://github.com/ryanb/nested_form

Couple things to consider: Use fields_for (this is to construct child form). Use nested_form to keep building child forms (n amount) - https://github.com/ryanb/nested_form

这篇关于包含嵌套表单的深层嵌套表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆