I have been searching around for a solution for quite some time, hoping someone could point me to an answer or alternative solution…
I am looking to implement a input name array using the Rails form helpers.
So traditionally in html, I would just write something like this:
<input type="text" name="email[]" value="blah" />
<input type="text" name="email[]" value="blah2" />
Does anyone know how an array like this can be achieved using rails helpers? { Doesnt work }
<%= f.text_field :email[] %>
<%= f.text_field :email[] %>
I appreciate it!
You can use the form tag helpers to create the inputs you want.
See here http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html for more info.
To use
text_fieldinstead of the tag version your modem would need to respond to theemail[]method.