Ruby Loop каждый с индексом
X.each_with_index do |item, index|
puts "current_index: #{index}"
end
Clumsy Capybara
X.each_with_index do |item, index|
puts "current_index: #{index}"
end