From: Michael Libby Date: 2008-12-14T04:42:38+09:00 Subject: Re: Accessing :object after render : partial On Sat, Dec 13, 2008 at 12:37 PM, Thierry Delbart wrote: > 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', :object => @course > > in the _course_detail.erb file I have: > > Distance*: <%= course.distance %>
/> > > 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 -- Michael C. Libby www.mikelibby.com