I’m trying to nest this
%h1 Admin Menu
%small logged in as: #{session[:username]}
To get something like this
<h1>Admin Menu <small>logged in as: something</small></h1>
But the only way I can get it to display without firing an error is putting them at the same level, say
%h1 Admin Menu
%small logged in as: #{session[:username]}
Which outputs:
<h1>Admin Menu</h1>
<small>logged in as: something</small>
It’s probaby something silly but I have no idea this why this wouldn’t work?
Haml only allows inline nesting if everything that will be nested is inline. So you can do this:
or this:
but not this:
The first form should really be thought of as a convenient abbreviation. It exists so you can take something like this:
and just say: