Connecting Tech Pros Worldwide Help | Site Map

Insert Multile Records ?

Newbie
 
Join Date: Oct 2007
Posts: 1
#1: Oct 2 '07
I am a newbie to Ruby and wondering how to insert multiple records at the same time.

I want to create a form such that it accept multiple records and save it to DB upon submitting the form instead of one record at a time.
Expert
 
Join Date: May 2007
Posts: 213
#2: Jul 8 '08

re: Insert Multile Records ?


My first thought is that you will want to set the form up in a way that you can, in the controller, loop all the form fields for each record. Then, as you loop, you should be able to validate each individual record. Using Javascript on the view side, you could allow rows to be added as needed, and it wouldn't affect the controller save method, since it just loops all fields.
Reply