I have a bunch of pictures to display on a page and I want to do 4 per
row.  This code works fine (inserting a <br> every 4th picture):

        <% i = 1 %>
        <% for photo in @photos do -%>
          <a href="/photos/show/<%=photo.id%>"><img
src="/photos/thumb/<%=photo.id%>"/></a>
          <% if (i.modulo(4) == 0) %>
            <br>
          <% end %>
          <% i = i+1%>
        <% end %>


but I was wondering if there is a more elegant way to do this.  Thanks.