简体   繁体   English

Rails:提交包含多行数据的表单

[英]Rails: submit a form with more than one row of data

I am working on a rails project and it is kind like the example in 'Railstutorial' Fig 7.11 我正在做一个Rails项目,有点像“ Railstutorial”中的示例图7.11

Mine is a little bit different. 我的有点不同。 I want the user can create more than one account at a time which means, i will have an extra button 'add' in order to stack up all the information. 我希望用户一次可以创建多个帐户,这意味着,我将有一个额外的按钮“添加”以堆积所有信息。

For instance, after filling out all the four textareas, you hit add, and you will stay in this page with the information showed up in a box, you can keep creating another account. 例如,填写完所有四个文本区域后,单击添加,您将停留在此页面中,并且该信息显示在一个框中,您可以继续创建另一个帐户。 And when you click on the 'create my account' button, all the data will be inserted into the database together while the page will be directed to some other url(I can do this part). 当您单击“创建我的帐户”按钮时,所有数据将一起插入数据库,而页面将定向到其他URL(我可以做这部分)。

But what I can do right now is only creating one account at one time. 但是我现在只能一次创建一个帐户。

Thank you very much!! 非常感谢你!!

我相信您正在寻找Cocoon ,它可以让您动态添加字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Ruby on Rails更新模型,其中单个表单包含多行 - Ruby on Rails update model with more than one row in a single form Rails从单个表单创建多个行 - Rails creating more than one row from a single form Rails:如何使用提交按钮创建多个表单,并执行不同的功能? - Rails : How to create more than one form with a submit button, doing different functionality? rails 4,collection_select,将多个属性传递到表单提交的params哈希中? - rails 4, collection_select, pass more than one attribute into params hash on form submit? 在提交多个表单(在Rails中)后,尝试在显示Ajax之后再次显示时提交JQuery Flash消息 - Trying to have a JQuery flash message after an ajax from submit in show again after more than one form submit (in rails) 如何使用rails中的一个表单更新多个字段 - How to update more than one field using one form in rails 可以在 form_for helper rails 3 中发送不止一种格式 - is possible send more than one format in form_for helper rails 3 HABTM表单提交的Rails值不止一个 - HABTM Form not submitting more than one value in rails Rails:一种用于创建和编辑多个资源的表单 - Rails: A form to create and edit more than one resource 将表单数据插入到两个表中,其中一个提交在rails中 - insert form data into two tables with one submit in rails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM