Rails 3 - more cycle helpers in one main loop
Good morning guys,
I have one big loop, in that are 3 others. The main loop uses cycle
for set background color of every row. In one of 3 loops is cycle
helper used too -- and I got "error", because is conflict among these two cycle
s. I solved this situation with each_with_in开发者_开发问答dex
, but - is possible use in this situation cycle
helper? Is possible the second cycle
separate something?
You can have multiple cycles in one loop by naming them:
<%= cycle("even", "odd", :name => "first_cycler" %>
精彩评论