If all you need to do is cycle, then you can use the "cycle" helper.
Like so:
- a.each do |item|
%li{ :class => cycle('style1','style2') } item
On 7/21/07, Vlad Rafeyev <[EMAIL PROTECTED]> wrote:
>
> Hello here :)
>
> I have a little array inside template:
>
> - a = %w{1 2 3}
>
> and I have a list, which made out of this array:
>
> - a.each do |i|
> %li
> a[i]
>
> If I want to display item1 with style1, and item2 with style2, what
> should I do? Where do I have to insert IF?
>
> Thank you!
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---