title: How can I access the :locals hash from inside a partial instead of the local variables with the same name?
body: <p>Apart from being a good idea or not, I would like to know how to access the :locals hash from inside a partial instead of the local variables with the same name?</p>
  
  <p>I'm attempting to try to explore a potentially more efficient approach to a pattern I often find myself in involving default partial values:</p>
  
  <pre><code>:locals =&gt; { :opts =&gt; {:myvar =&gt; @myvar}}
  </code></pre>
  
  <p>Then inside partial:</p>
  
  <pre><code>opts.reverse_merge!(defaults)
  </code></pre>
  
  <p>It would be a lot cleaner to write (especially when opts get more numerous):</p>
  
  <pre><code>:locals =&gt; { :myvar =&gt; @myvar}
  </code></pre>
  
  <p>Then inside partial:</p>
  
  <pre><code>opts =&gt; defaults.merge(local_hash)
  </code></pre>