It works!
On Jul 2, 5:23 pm, Brad Wilson <[EMAIL PROTECTED]> wrote:
> Something like:
>
> %tr{ :class => cycle('row1', 'row2') }
>
> should take care of it. That hash can have any key/value pair you like
> - style, href, rel, etc.
>
> On 03/07/2008, at 8:17 AM, Jesse wrote:
>
>
>
> > I'm working my way through a very basic app for learning purposes.
>
> > here is the code, which works, but I cant figure out how to get the
> > rows to alternate class with /cycle('row1', 'row2')/
>
> > %h2 List
> > %table
> > %tr
> > %th Created
> > %th Title
> > %th Author
> > %th Content
> > %th Status
> > - for post in @posts
> > %tr # I have no idea how to use the cycle function here, please
> > help!
> > %td= post.created_at.strftime '%m/%d/%y %I:%m %p'
> > %td= h post.title
> > %td= h post.author_id
> > %td= h post.content
> > %td= h post.status
> > - end
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to haml@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---