0
我有一些代碼:手動輸出HAML開始和結束標記
- 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做到這一點。有任何想法嗎?
非常感謝 – trobrock 2010-05-31 00:13:16