Partial not passing

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!

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"

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?

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

Fred

Frederick Cheung wrote: