Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:28:21+00:00 2026-05-30T05:28:21+00:00

In my new views page I have: <% 10.times do %> <%= render ‘group_member_form’

  • 0

In my new views page I have:

<% 10.times do %>
  <%= render 'group_member_form' %>     
<% end %>

Now this form contains the fields: first_name, last_name, email_address and mobile_number. Basically I want to be able to fill in the fields of all the forms in one click which then submits each into the database as a unique row/id.

What would be the easiest way to accomplish this?

Note: The number of times do is called from a variable. Any advice welcome, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:28:22+00:00Added an answer on May 30, 2026 at 5:28 am

    You should have only one form (you should put only fields in the group_member_form partial). In your view 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]" %>
    

    This way, when the form submits, params[:members] in the controller will be an array of member hashes. So, for example, to get the email adress 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 like this, take a glance at this:

    http://guides.rubyonrails.org/form_helpers.html#understanding-parameter-naming-conventions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in some of my ASCX files: <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, Edit, Widget, new
How to view all the content in my IsolatedStorageFile by setting a new page
I created a new View (LogView) in Infrastructure.Module project. This view will be used
I've just created a new view based application, and now I want to set
I need to have a new view(w/ ViewController) added over the top of another.
I have a rather simple informational website that's being run by Django. Its' pages(views)
I have a page that has a bunch of widgets on it. Each widget
I have built a blog using Ruby on Rails. New to both. I am
I have a registration form that when the user enters in valid registration data
Currently I have a view which I render to a template and return it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.