title: Create a helper or something for haml with ruby on rails
body: <p>I am using haml with my rails application and i have a question how the easiest way to insert this haml code into a html file:</p>
  
  <pre><code>&lt;div clas="holder"&gt;
   &lt;div class=top"&gt;&lt;/div&gt;
    &lt;div class="content"&gt;
     Content into the div goes here
    &lt;/div&gt;
   &lt;div class="bottom"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I want to use it in my haml document like this:</p>
  
  <pre><code>%html
   %head
   %body
    Maybee some content here.
    %content_box #I want to get the code i wrote inserted here
     Content that goes in the content_box like news or stuff
   %body
  </code></pre>
  
  <p>Is there an easier way to do this?</p>
  
  <hr>
  
  <p>I get this error:</p>
  
  <pre><code>**unexpected $end, expecting kEND**
  </code></pre>
  
  <p>with this code:</p>
  
  <pre><code># Methods added to this helper will be available to all templates in the application.
  module ApplicationHelper
   def content_box(&amp;block)
    open :div, :class =&gt; "holder" do # haml helper
     open :div, :class =&gt; "top"
      open :div, :class =&gt; "content" do
        block.call
      open :div, :class =&gt; "bottom"
    end
   end
  end
  </code></pre>