From: RKH Date: 2008-07-15T05:15:28+09:00 Subject: Re: how to loop through two arrays in parallel On 14 Jul., 22:03, Mitchell Gould wrote: > I have two arrays from a form. > > params[:products] and params[:quantity] > > which are products[] and quantity[] > > I would like to extract the data from each item to get their name and > quantity. > > Is there a way in Ruby to do this? > > for product in products[] and quantity in quantity[]? > -- > Posted viahttp://www.ruby-forum.com/. What are you going to do with it. Probably I hash would be a better idea... products.each_with_index do |product,index| puts "Quantity for #{product} is #{quantity[index]}" # or what ever you want to do end