You should have only one form (you should only place the fields in the group_member_form part). In your opinion, you should have something like:
<%= form_tag "/members" do %> <% 10.times do %> <%= render 'group_member_form' %> <% end %> <%= submit_tag "Submit" %> <% end %>
and in _group_member_form.html.erb you should have
<%= text_field_tag "members[][first_name]" %> <%= text_field_tag "members[][last_name]" %> <%= text_field_tag "members[][email_address]" %> <%= text_field_tag "members[][mobile_number]" %>
Thus, when the form is submitted, params[:members] in the controller will be an array of hashes of the elements. So, for example, to get the email address from the fourth member after submitting the form, you call params[:members][3][:email_adress] .
To understand why I wrote _group_member_form.html.erb as follows, take a look at this:
http://guides.rubyonrails.org/form_helpers.html#understanding-parameter-naming-conventions .
source share