title: How to pass local variable to partial from application layout in rails 3?
body: <p>I have a couple of variables that need to be called in all controllers. Displaying latest news in the layout footer.</p>
  
  <p>I create them in application_controller.rb</p>
  
  <pre><code>@hq_news_item = NewsItem.where(:branch_code =&gt; "CORP").first
  @branch_news_item = NewsItem.where(:branch_code =&gt; "MN").first
  </code></pre>
  
  <p>In my layouts/application.html.haml</p>
  
  <pre><code>= render :partial =&gt; "layouts/footer_news"  , :hq_news_item =&gt; @hq_news_item, :branch_news_item =&gt; @branch_news_item
  </code></pre>
  
  <p>And then in my layouts/_footer_news I style them</p>
  
  <pre><code>= hq_news_item.title
  = hq_news_item.author.name
  ... etc
  </code></pre>
  
  <p>Here is the thing, no matter what I do - it keeps saying that hq_news_item is undefined in partial.</p>
  
  <p>All my other partials work fine. I think it has to do with the fact that it's a layout not a view. Can't find anything meaningful in the docs.</p>
  
  <p>Any ideas?</p>
  
  <p>Thank you.</p>