title: Passing data to layout templates with Slim-lang
body: <p>I have a problem with passing data to Slim templates. I have the following <strong>working</strong> code (using information from <a href="https://stackoverflow.com/questions/7058993/specifying-a-layout-and-a-template-in-a-standalone-not-rails-ruby-app-using-s">this SO thread</a>):</p>
  
  <pre><code>l = Slim::Template.new { @layout } # How to pass data here?
  
  _p = Slim::Template.new { @post_text }.render(Object.new, :post =&gt; post)
  # Here passing data (post) works fine     -----------------^
  
  out = l.render{ _p }
  </code></pre>
  
  <p>What I have in templates:</p>
  
  <p><strong>layout.slim</strong>:</p>
  
  <pre><code>doctype
    html
    head
      title =my_title # &lt; I cannot pass any parameters to this file
    body
      ==yield
  </code></pre>
  
  <p><strong>post_text.slim</strong>:</p>
  
  <pre><code>-unless post.nil?
    h1 =post[:title]
    hr
    =post[:text]
  -else
    h2 No posts
  </code></pre>
  
  <p>My question is how to pass parameters to layout template in my case?</p>