Thank you, I wanted exactly this

But is there a way not to put "-" in the beginning of every pure ruby
line? Maybe set the beginning and the end of "pure ruby" script?

RHTML templates have this possibility :)

On Jul 21, 8:50 pm, Jens-Christian Fischer <[EMAIL PROTECTED]>
wrote:
> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to