Or you can extract the Rails cycle() helper into your own helper module,
and use that module when you run the Haml engine.
(note, cycle() is a method in rails, not ruby)
On Dec 18, 2007 1:54 PM, Mislav Marohnić <[EMAIL PROTECTED]> wrote:
> On Dec 18, 2007 12:45 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
>
> >
> > I had a question that I wasn't able to find an answer for anywhere on
> > the web - that might be a bad sign. I'm trying to zebra stripe lists
> > using something like Ruby's cycle() view helper, but haml doesn't seem
> > to like me even thinking about it. Is there some easy, dead simple
> > way that I'm just missing to zebra stripe lists with haml?
>
>
> Try this:
> %li{ :class => (index % 2).zero?? 'even' : 'odd' }
>
> When using ActionView in Rails, you can use the `cycle` helper instead of
> the arithmetic and ternary operator used in my example.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---