So I’m converting all my html.erb files to html.haml because haml is beautiful and clean. I used this tutorial to convert all the files at once rather than one at a time. But I’ve come across an error that I’m not sure how to get it to work properly.
#main.column{:class => "has_sidebar" if content_for?(:sidebar)}
in html.erb it would be:
<div id="main" class="column has_sidebar"> #if :sidebar exists
<div id="main" class="column"> #if :sidebar does not exists
So how would I go about getting this to work? thanks so much!
Try giving the haml code like this :-