On Feb 5, 4:44 pm, "reube...@gmail.com" <reube...@gmail.com> wrote: > Not sure if I worded that Subject line correctly... :P > > Anyway, I want to be able to do something similar to the following > when processing form data: > Your problem here is that the hash keys are strings, not numbers
Fred > 1..5.each do |number| > if params[:data][number] == '1' # <-- using block variable > "number" as a hash key does not seem to work... > foo.bar > end > end > > The if statement is never evaluated as true, but at the same time no > errors pop up. > > What is the proper means of doing the equivalent? > > -Reuben -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.