Accessing :object after render : partial

T

Thierry Delbart

Hello,

I'm running into an issue I don't understand (I'm new to ruby):
in my "Journey" controller / "course_detail" action I render the
following partial (this is call by a Prototype Ajax function):

render :partial => 'courses/course_detail', :eek:bject => @course

in the _course_detail.erb file I have:

Distance*: <span id="courseDistance"> <%= course.distance %></span><br
/>

BUT I tells me "course" doesn't exist: "undefined local variable or
method 'course'"

Please, can someone help me through this one???
 
M

Michael Libby

Hello,

I'm running into an issue I don't understand (I'm new to ruby):
in my "Journey" controller / "course_detail" action I render the
following partial (this is call by a Prototype Ajax function):

render :partial => 'courses/course_detail', :eek:bject => @course

in the _course_detail.erb file I have:

Distance*: <span id="courseDistance"> <%= course.distance %></span><br
/>

BUT I tells me "course" doesn't exist: "undefined local variable or
method 'course'"

Please, can someone help me through this one???

Probably the @course object is available in your partial in a variable
named course_detail

If that doesn't work, try your question in the Rails Forum
http://www.ruby-forum.com/forum/3 -- the ruby-talk list is for general
Ruby discussion. The Rails forum is all Rails all the time. You'll get
a much more authoritative response there.

-Michael
 
R

Ryan Davis

I'm running into an issue I don't understand (I'm new to ruby):
in my "Journey" controller / "course_detail" action I render the
following partial (this is call by a Prototype Ajax function):

please ask these questions on the rubyonrails mailing list.
 
T

Thierry Delbart

Sorry I looked at the forum list and I thought this was the more
accurate. Next time I'll post those questions in forum 3.

And thanks Mickael, you got it right. Sometimes I really don't
understand the naming of ROR.

Thanks for you help!

-------- SOLVED
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top