# Partial not passing

**URL:** <https://www.ruby-forum.com/t/partial-not-passing/133076>\
**Category:** Rails\
**Created:** [March 27, 2008, 2:04pm UTC](https://www.ruby-forum.com/t/partial-not-passing/133076 "2008-03-27T14:04:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hgtesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/919ad9/32.png) [@hgtesta](https://www.ruby-forum.com/u/hgtesta)\
**Post date:** [March 27, 2008, 2:04pm UTC](https://www.ruby-forum.com/t/partial-not-passing/133076/1 "2008-03-27T14:04:27Z")

</div>

Hi there,

I have a partial like this:

\<%= render :partial =\> @person.address %\>

and in app/views/addresses/\_address.html.erb:

Street: \<%= address.street %\>

But address in the partial is nil… shouldn’t the local variable  
‘address’ be available in the partial? And why is it nil?

Thanks!

---

<div class="post-metadata">

**Author:** ![hgtesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/919ad9/32.png) [@hgtesta](https://www.ruby-forum.com/u/hgtesta)\
**Post date:** [March 27, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/partial-not-passing/133076/2 "2008-03-27T14:06:21Z")

</div>

Sorry the wrong title, it seems that Safari on windows cut some text on  
text fields. The title should be: “Partial not passing local variables”

---

<div class="post-metadata">

**Author:** ![hgtesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/919ad9/32.png) [@hgtesta](https://www.ruby-forum.com/u/hgtesta)\
**Post date:** [March 27, 2008, 2:13pm UTC](https://www.ruby-forum.com/t/partial-not-passing/133076/3 "2008-03-27T14:13:17Z")

</div>

On 27 Mar 2008, at 13:04, Henrique T. wrote:

> But address in the partial is nil… shouldn’t the local variable  
> ‘address’ be available in the partial? And why is it nil?

Did you mean to write render :partial =\> ‘address’, :object =\>  
@person.address ?

Fred

---

<div class="post-metadata">

**Author:** ![hgtesta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/919ad9/32.png) [@hgtesta](https://www.ruby-forum.com/u/hgtesta)\
**Post date:** [March 27, 2008, 2:32pm UTC](https://www.ruby-forum.com/t/partial-not-passing/133076/4 "2008-03-27T14:32:26Z")

</div>

Frederick C. wrote:

> On 27 Mar 2008, at 13:04, Henrique T. wrote:
> 
> > But address in the partial is nil… shouldn’t the local variable  
> > ‘address’ be available in the partial? And why is it nil?
> 
> Did you mean to write render :partial =\> ‘address’, :object =\>  
> @person.address ?
> 
> Fred

Doesn’t Rails Edge have this syntax? Now I am confusing… I saw this on  
a ticket but now I can’t find it. The right partial is rendered,  
although the local variable ‘address’ is nil.

Anyway, using :object works fine, thanks!
