Collecting data from many instance of same field


#1

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:

Email: <%= text_field 'invitation', 'recipient_email', :onkeyup => 'verifyInput()' %>

Email: <%= text_field 'invitation', 'recipient_email', :onkeyup => 'verifyInput()' %>

Email: <%= text_field 'invitation', 'recipient_email', :onkeyup => 'verifyInput()' %>

Email: <%= text_field 'invitation', 'recipient_email', :onkeyup => 'verifyInput()' %>

Email: <%= text_field 'invitation', 'recipient_email', :onkeyup => 'verifyInput()' %>

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


#2

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


#3

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?