开发者

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 cycles. 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" %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜