2011-12-28 60 views

回答

5
%tr{ class: cycle('list_line_odd', 'list_line_even') } 

響應的評論,它是一個單獨的問題:

這是您的源,從pastie:上述

%tr{:class => cycle('list_line_odd', 'list_line_even')} 
    %th 
    - @books.each do |book| 
    %tr 

適用cycle最外表格行,不是每個人的書的行:

%tr 
    %th 
    - @books.each do |book| 
    %tr{ class: cycle('list_line_odd', 'list_line_even') } 
+0

yeap,我試過了,但它對我來說不起作用。我做錯了什麼? http://www.pastie.org/3084886 – TiSer 2011-12-28 14:45:53

+0

@TiSer嗯;它是如何渲染的? – 2011-12-28 14:51:30

+0

你是什麼意思? – TiSer 2011-12-28 14:55:11