From: Andrew Timberlake Date: 2009-08-18T15:21:06+09:00 Subject: Re: conditional logic in HAML On Tue, Aug 18, 2009 at 2:58 AM, Noel Kelly wrote: > In the Haml tutorial has this sample: > > ERB > >
>  
>    

Welcome to our site!

>    

<%= print_information %>

>  
>  
>    <%= render :partial => "sidebar" %> >  
>
> > Haml > > #content >  .left.column >    %h2 Welcome to our site! >    %p= print_information >  .right.column >    = render :partial => "sidebar" > > I want to convert a similar block that includes a conditional, but can't > find/google how to do it. Is it possible? > > ERB > > <% if ENV["RACK_ENV"] == "production" %> >  <%= render :partial => "ga" %> > <% else >  
>    Google Analytics in prod >  
> <% end %> > > Haml > -if ENV["RACK_ENV"] == "production" =render :partial => "ga" -else .dev.dummy Google Analytics in prod Andrew Timberlake http://ramblingsonrails.com http://MyMvelope.com - The SIMPLE way to manage your savings