Count each loop

I am trying to get the iteration number of a loop I am on. I tried

objects.each do |object, i|

but i is nil

Any ideas?

On Thu, Aug 7, 2008 at 3:53 PM, Joel Saltzmanjoelh
[email protected] wrote:

I am trying to get the iteration number of a loop I am on. I tried

objects.each do |object, i|

objects.each_with_index do |o, i|

martin