Forum: Ruby on Rails You have a nil object when you didn't expect it!

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ead43bcb0202410540a6a7cee5955d46?d=identicon&s=25 Fresh Mix (giga)
on 2009-01-09 11:06
<% if @flash[:error] %>
    <div id="error"><%= @flash[:error] %></div>
<% end %>
<% if @flash[:warning] %>
    <div id="warning"><%= @flash[:warning] %></div>
<% end %>
<% if @flash[:notice] %>
    <div id="notice"><%= @flash[:notice] %></div>
<% end %>

------

You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

How I must do it?
9cf6e7f81d4339295b86e5fb7d7df49b?d=identicon&s=25 Vishwanath Nayak (nayak)
on 2009-01-09 11:24
(Received via mailing list)
Hi,

Did you see any line number in the error?
It would be helpful if you gould give the whole trace rather than just
the
error message

NAYAK

On Fri, Jan 9, 2009 at 3:36 PM, Gi Ga
<rails-mailing-list@andreas-s.net>wrote:

>
> >
>


--
- NAYAK
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-01-09 11:28
(Received via mailing list)
> How I must do it?
could it be, it's "flash[:notice]" without the @.

if not, tell us where your error occurred (which line). then show us
the code calling it (controller/action).
Ead43bcb0202410540a6a7cee5955d46?d=identicon&s=25 Fresh Mix (giga)
on 2009-01-09 12:00
MaD wrote:
> could it be, it's "flash[:notice]" without the @.

Thanks, now it works.
This topic is locked and can not be replied to.