>
>
> I want this:
>
> <%
> if a
> classname = "a"
> elsif b
> classname = "b"
> else
> classname = "default"
> end
> %>
>
> %li {:class => classname}
>
> Is this possible?
>
The HAML purity gurus would probably tell you to put this into a
helper, but if you want to do it inside HAML, it would look like this:
- a.each do |n|
- if n == "x"
- classname = "a"
- elsif ...
- classname = "b"
- ...
%li{ :class => classname }
I would also go for a helper...
cu jc
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---