The best way to do this is:
<% products.each_with_index { |product, index| %>
<%= product.size %>
<% } %>
You should forget for, it is not needed in Ruby Land. Enumerations
such as each are more efficient when you get to more interesting cases
- check out the documentation for Enumerable
(http://ruby-doc.org/core/classes/Enumerable.html) and Array
(class Array - RDoc Documentation)
Forget the For loop - it’s so 1998!