How do i do an inline if statement in haml

haml, ruby, ruby-on-rails, ruby-on-rails-3

Solution

You can do this:

%table.form_upper{:style => "display:#{condition ? 'none' : ''};", :id => 'profile-info'}

Problem

I have this haml ``` %table.form_upper{:style => "display:none;", :id => 'profile-info'} %tr{:id => 'some-row'} ``` How do i do display none on this table if a condition is met like for example i know i can do this but i feel there has got to be an inline way of doing this ``` -if condtion %table.form_upper{:id => 'profile-info'} -else %table.form_upper{:style => "display:none;", :id => 'profile-info'} %tr{:id => 'some-row'} ```

Original source