开发者

Rails 3 - more cycle helpers in one main loop

开发者 https://www.devze.com 2023-03-30 23:03 出处:网络
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\", becaus

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

精彩评论

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