Rail 3 UJS复合体形成多个字段_for
我有一个里程碑,有很多任务。在我的项目显示页面上,我希望能够创建一个里程碑,其中包含用户决定添加到里程碑中的许多任务。如何使用添加更多任务
milestone_form.fields_for :tasks
?
I have a milestone with many tasks. On my project show page, I want to be able to create a milestone with however many tasks the user decides to add to the milestone. How do I add more tasks using
milestone_form.fields_for :tasks
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过搜索动态添加表单来回答我的问题。瑞安的残片也给了我一点帮助。
https://github .com/alloy/complex-form-examples/blob/a234fde4419836f277d7e340657f1d8418911d68/app/views/projects/_form.html.erb#L40
Answered my question with a search for dynamically adding forms. And a little help from Ryan's scraps.
https://github.com/alloy/complex-form-examples/blob/a234fde4419836f277d7e340657f1d8418911d68/app/views/projects/_form.html.erb#L40