I've got a list of items I'm looping in an each in my show view. This is all perfectly fine. However, I would like to get a number infront of each item which increments with every loop ( i = 0, i++ you know the drill ).
Now, how can i do this in Rails? This is what I get by now:
<% i = 0 %>
<% @trip.triplocations.each do |tl| %>
<article id="<%= dom_id(tl) %>">
<strong> <%= tl.title %> </strong>
<p>
<%= tl.description %>
</p>
</article>
<% end %>