Let's first start with a code snippet to explain the issue:
= Haml::Engine.new('#bar= yield').render do
this should show up inside div#bar, right?
Given that code and according to the haml::engine docs and more than one stackoverflow post, I would expect that the string "this should show up inside of the div, right?" would in fact end up inside the div#bar element, resulting in some html looking like this:
<div id="bar">
this should show up inside of the div, right?
</div>
However, this is what I actually get:
this should show up inside of the div, right?
<div id="bar">
0
</div>
So, two questions:
- Why does the content from the block show up outside div#bar and
- What is that 0 inside the div#bar element?