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.
<div class="banner <%= cycle :left, :center, :right %>">
But then i split it up to also display the category name like so.
<% @categories.each do |category| %>
<div class="category">
<h3><%= category.name %></h3>
<%= render :partial => "/shared/banner", :collection =>
category.products %>
</div>
<% end %>
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?
Thanks. mike