How do I format a view to handle multiple instances of the same field. For example, I want to send an email to several recipients. I list the same field 5 times: <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', :onkeyup => ''verifyInput()'' %></p> <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', :onkeyup => ''verifyInput()'' %></p> <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', :onkeyup => ''verifyInput()'' %></p> <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', :onkeyup => ''verifyInput()'' %></p> <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', :onkeyup => ''verifyInput()'' %></p> I can''t seem to collect the various instances of the input within the controller. I have also tried the text_field_tag. Would greatly appreciate any help. Thanks. Mario -- 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 -~----------~----~----~----~------~----~------~--~---
You need to give each one unique names like invitation1, invitation2, etc. Then you can place them in a separate table or whatever you want to do with them. Michael Mario T. Lanza wrote:> How do I format a view to handle multiple instances of the same field. > For example, I want to send an email to several recipients. I list the > same field 5 times: > > <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', > :onkeyup => ''verifyInput()'' %></p> > <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', > :onkeyup => ''verifyInput()'' %></p> > <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', > :onkeyup => ''verifyInput()'' %></p> > <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', > :onkeyup => ''verifyInput()'' %></p> > <p><label>Email:</label> <%= text_field ''invitation'', ''recipient_email'', > :onkeyup => ''verifyInput()'' %></p> > > I can''t seem to collect the various instances of the input within the > controller. I have also tried the text_field_tag. > > Would greatly appreciate any help. Thanks. > Mario > > -- > 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 -~----------~----~----~----~------~----~------~--~---
> You need to give each one unique names like invitation1, invitation2, etc.Thanks... I realized this possibility, however, I was looking to treat them as an array. Does Rails handle converting multiple like-named inputs to an array? -- 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 -~----------~----~----~----~------~----~------~--~---