Hi Supposing i have a table Employees as follows =========================id | Name | Age | Salary | ========================= and use scaffold while generating model, view and controller by the command. ruby script/generate scaffold Employee When I go to the new entry page by choosing http://localhost:3000/Employees/new I get a form with 3 fields after entering which and pressing submit buttons the entries are submitted to the database. I i have to add one more entry i have to again press on new link and again enter them followed by pressing submit button. I will have to repeat the process 100 times if i have to enter hundred records. Instead can I have multiple rows of input, so that i can enter all of them and press a single submit button, after which all the entries are submitted to the database? Please let me know the approach i need to follow to achive this. Thnaks Prasanna -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It''s possible to enter multiple rows of input. Check into using the array notation for your object (e.g., ''users[]''). However, I''d think through whether that makes sense in this particular case. You may have 100 users to add _initially_ and that might be a bit annoying, but is the "add a user" use case going to be used for multiple user entries very often? It sounds like an edge case. On May 19, 8:46 am, Prasanna kumar Nagasamudram <rails-mailing- l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > > Supposing i have a table Employees as follows > =========================> id | Name | Age | Salary | > =========================> > and use scaffold while generating model, view and controller by the > command. > > ruby script/generate scaffold Employee > > When I go to the new entry page by choosing > > http://localhost:3000/Employees/new > > I get a form with 3 fields after entering which and pressing submit > buttons the entries are submitted to the database. > > I i have to add one more entry i have to again press on new link and > again enter them followed by pressing submit button. I will have to > repeat the process 100 times if i have to enter hundred records. > > Instead > can I have multiple rows of input, so that i can enter all of them and > press a single submit button, after which all the entries are submitted > to the database? > > Please let me know the approach i need to follow to achive this. > > Thnaks > Prasanna > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
AndyV wrote:> It''s possible to enter multiple rows of input. Check into using the > array notation for your object (e.g., ''users[]''). > > However, I''d think through whether that makes sense in this particular > case. You may have 100 users to add _initially_ and that might be a > bit annoying, but is the "add a user" use case going to be used for > multiple user entries very often? It sounds like an edge case. > > On May 19, 8:46 am, Prasanna kumar Nagasamudram <rails-mailing-Thanks for the response Andy. Well im tying to devolop an application which simulates a time sheet(status report). Where user may have to enter multiple rows of data. Say for example Project1 task1 10hrs Project1 task2 20hrs Project3 task1 5 hrs etc. and press submit button. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---