title: Output haml content via :ruby filter
body: <p>When I use the <code>:ruby</code> filter to do some simple stuff in haml, for example...</p>
  
  <pre><code>:ruby
    to = comments &gt; max_comments ? max_comments : comments
    (0...to).each do |i|
      comment = data[i]
      puts li_comment comment[0], comment[1], comment[2]
    end
  </code></pre>
  
  <p>the <code>puts</code> statement writes the output to the console. The <a href="http://haml.info/docs/yardoc/file.REFERENCE.html#ruby-filter" rel="nofollow">docs for :ruby</a> indicate that it </p>
  
  <blockquote>
    <p>Creates an IO object named <code>haml_io</code>, anything written to it is output
    into the Haml document.</p>
  </blockquote>
  
  <p>How exactly does one <em>use</em> the haml_io object to write to the haml document, but not to the console (think I need something other than <code>puts</code>)?</p>