# Rendering a partial with locals from applicat\_helper

**URL:** <https://www.ruby-forum.com/t/rendering-a-partial-with-locals-from-applicat-helper/123413>\
**Category:** Rails\
**Created:** [December 17, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/rendering-a-partial-with-locals-from-applicat-helper/123413 "2007-12-17T14:07:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabru](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c0e974/32.png) [@gabru](https://www.ruby-forum.com/u/gabru)\
**Post date:** [December 17, 2007, 2:07pm UTC](https://www.ruby-forum.com/t/rendering-a-partial-with-locals-from-applicat-helper/123413/1 "2007-12-17T14:07:49Z")

</div>

i have the following method in my application\_helper.rb

def test  
render(:partial =\> ‘/application/errors’, :locals =\> {  
:detail\_msgs =\> ‘testing…’,  
:headline =\> [‘asd’, ‘wwww’],  
:msgs =\> [‘adssaad’]})  
end

when I call this within one of my views it does not recognize the locals  
and it results in an error that the var does not exists. when i remove  
the vars within the partial then its rendered fine … but i need the  
locals there

i am using rails 2.0.1

thx for any help!

---

<div class="post-metadata">

**Author:** ![gabru](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c0e974/32.png) [@gabru](https://www.ruby-forum.com/u/gabru)\
**Post date:** [December 17, 2007, 3:56pm UTC](https://www.ruby-forum.com/t/rendering-a-partial-with-locals-from-applicat-helper/123413/2 "2007-12-17T15:56:04Z")

</div>

i took me quite a while to find the problem but finally i found the  
“stupid” mistake … within the partial i used the locals as instance  
vars instead of common vars …

so instead

\<%= @headline %\>

i use

\<%= headline %\>

yep … now i wont forget this for sure 🙂

solved
