Im trying to display lists of products on a page which is split up into categories which is fine but, the way they are displayed is in a 3xwhatever grid so i was using cycle in my partial to set css styles for the spacing.
[code] <div class="banner <%= cycle :left, :center, :right %>"> [/code]
But then i split it up to also display the category name like so.
[code] <% @categories.each do |category| %> <div class="category"> <h3><%= category.name %></h3> <%= render :partial => "/shared/banner", :collection => category.products %> </div> <% end %> [/code]
Problem is. the cycle does not "restart" after each loop of the block so they get out of order if a preceding category has an even number of products. is there any way to force the cycle back to "left" after each pass?