在单双行显示不同的颜色

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<%@items = [1,2,3,4]%>
  "row_class") -%>">
  <% @items.each do |item| %>
    "colors") -%>">
      item
   
  <% end %>
<% reset_cycle("colors") %>
 

 
  <%@items = x = [{:first => 'Robert', :middle => 'Daniel', :last => 'James'},
               {:first => 'Emily', :middle => 'Shannon', :maiden => 'Pike', :last => 'Hicks'},
              {:first => 'June', :middle => 'Dae', :last => 'Jones'}]%>
  <% @items.each do |item| %>
    "row_class") -%>">
     
        <% item.values.each do |value| %>
          <%# Create a named cycle "colors" %>
          "colors") -%>">
            <%= value %>
         
        <% end %>
        <% reset_cycle("colors") %>
     
  
<% end %>