[英]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.