How to Loop through mulitple field data no model

Mitchell Gould wrote:

I am creating a form for users to add part information. I want to include 5 text fields to gather part numbers.

The user then submits the forms.

Question: Is there a ruby way to loop through the form fields info and extract it on each loop?

Thank you for your time in advance.

Mitch

To Clarify,

The 5 text fields are for part numbers. The user can enter up to 5 part numbers. Then click submit.

Mitchell Gould wrote:

I am creating a form for users to add part information. I want to include 5 text fields to gather part numbers.

The user then submits the forms.

Question: Is there a ruby way to loop through the form fields info
and extract it on each loop?

If the inputs are all names parts then params[:parts] will be an
array containing the 5 entries.

Fred

Frederick Cheung wrote:

Mitchell Gould wrote:

Frederick Cheung wrote:

If the inputs are all names parts then params[:parts] will be an array containing the 5 entries.

Fred

That makes sense. I will give it a try.

Thanks Fred

I tried to user the following for the inputs            <%=text_field_tag item %>

But I get teh following error

undefined local variable or method `item' for #<#<Class:0x35167bc>:0x3516780>

Mitchell Gould wrote: > Frederick Cheung wrote:

>> If the inputs are all names parts then params[:parts] will be an >> array containing the 5 entries.

>> Fred

> That makes sense. I will give it a try.

> Thanks Fred

I tried to user the following for the inputs <%=text_field_tag item %>

But I get teh following error

well yes, there is no local variable called item. You need to pass text_field_tag the name you want ie 'item'

Fred

Frederick Cheung wrote: