我有一些代码:
- count = 0
- @clients.each do |client|
%div{:class => "grid_2#{(" alpha" if (count % 3) == 0) || (" omega push_2" if (count % 3) == 2) || " push_1"}"}= link_to h(client.name), client
- count += 1
我想在div
语句之后输出一个开始each
标记(count % 3) == 0
如果(count % 3) == 2
将结束标记放在块的末尾但我无法弄清楚如何让HAML这样做。有什么想法吗?