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?
Thanks. mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---