I want to change the backcolor of every rows of a table but I am not quite sure what is the best way to do it. Personally, I want to change on backcolor with ruby codes,but i dont know how :(
here is my code:
<% @word.each do |w| %>
<% i=0 %>
<% i=i+1 %>
<% if i % 2==0 %>
........
Thank you for your helps
Ba开发者_StackOverflow中文版bak
Use cycle it's exactly what you need.
精彩评论