<% count = 0 %> <% for @nickname in @nicknames %> <% count += 1 %> <% end %>