It’s as simple as adding this to the class attribute of your table row:
RUBY:
- <%= cycle(‘odd’,’even’) %>
In the CSS, just add:
CSS:
- .even { background: #efefef; }
- .odd { background: #a5a5a5; }
or whatever color you’d like. Ruby on Rails just flat out rocks sometimes.
Technorati Tags:
rubyonrails, css
2 responses so far ↓
1 Michael // Mar 27, 2007 at 2:15 pm
OK, this blog is almost a year old, but it’s just what I needed.
Awesome! Thanks
2 Lorin Rivers // Apr 5, 2007 at 1:18 pm
It’s the little things. Thanks for this tip!