Forum: Ruby on Rails strange partial error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sam J. (Guest)
on 2006-05-16 15:37
(Received via mailing list)
I'm getting this weird partial problem.

I'm calling the partial like so:

<%= render :partial => partial,
:locals => {:message => message,
:display => display,
:indent => indent,
:button_type => button,
:terms => params[:search_terms]} %>

The object in message can be printed out first, and then within the
partial I can access it, and it returns false to message.nil? but when I
try to access elements like message.title from within the partial
template itself I get errors like this:

You have a nil object when you didn't expect it!
The error occured while evaluating nil.title

Any ideas?

Many thanks in advance.

This topic is locked and can not be replied to.