You should indent the "unless" so that it's within the "%dl", like so:
http://gist.github.com/295348

On Thu, Feb 4, 2010 at 4:47 PM, assembler <[email protected]> wrote:

> Hi guys!
>
> I'm new to haml. Everyone seem to be talking about haml and sass
> recently, so I've decided to give it a try. First impressions are
> awsome! Its a little bit complicated to get used to.. but hey, its my
> first day :) I've developed small AddressBook jQuery/rails
> applicaiton.
>
> I have following code in my application:
>
> %dl
>  %dt= t "labels.#{address.label}"
> - unless address.street.blank?
>  %dd= address.street
>
> Output html is:
> <dl>
>  <dt>home</dt>
> </dl>
> <dd>15215 Lincoln Pl</dd>
>
> And i need it to be:
> <dl>
>  <dt>home</dt>
>  <dd>15215 Lincoln Pl</dd>
> </dl>
>
> How to set output condition logic right? I've tried many ways, some
> give me empty <dd>'s, some give me invalid identation errors. What to
> do?
>
> --
> 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] <haml%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
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