search for: each_with_styl

Displaying 1 result from an estimated 1 matches for "each_with_styl".

Did you mean: each_with_styles
2006 Apr 05
0
each_with_styles, for adding CSS classes
...problem that everyone has come across is applying styles to rows of information--pinstriping, or specifically marking the first or last row. I came up with a general solution, and so am offering it up here in case anyone finds it useful. The solution is a method, added to the Array class, called each_with_styles. Give it a hash and a block, and it will call the block with two block parameters. The first will be the item, like Array::each does, and the second will be a string containing the list of relevant classes (as given by the hash). Hope it comes in helpful! ~Mark Josef EXAMPLE: array = ['...