Forum: Ruby on Rails diffrnce between flash[:message] and flash[:notice] and ..

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.
85c15595356c7d4e5d69ab33c03438dc?d=identicon&s=25 Sharma Chelluri (rubysharma)
on 2007-03-01 13:52

How could i learn the diffrence between  flash[:message] and
flash[:notice] and flash[:warning].

In the global layout of any rails project..scafflod is only put
flash[:notice]. If i declare flash[:message].. its not displaying on

Can any one point me to right tutorials on this flash objct and error

Thanks in advance,
Aa9467ff6b698dce20d0d7252e5a268f?d=identicon&s=25 Joram (Guest)
on 2007-03-01 13:58
(Received via mailing list)
There is no difference between them.

The flash is basically a hash, where values are retrieved by using a

so flash[:notice] gives you the value that belongs to notice,
flash[:something] gives you the value corresponding to the
key :something.

This means that in your controller you can do:

def some_method
  flash[:otice] = 'this is a notice'
  flash[:something_else] = 'this is something else]

which you can use in your view:

<%= flash[:notice] %>
<%= flash[:something_else %>

I was first also confused about the flash, I hope this helps

On 1 mrt, 13:52, Sharma Chelluri <>
Aa9467ff6b698dce20d0d7252e5a268f?d=identicon&s=25 Joram (Guest)
on 2007-03-01 13:59
(Received via mailing list)
off course some typos :

controller has to be :

def some_method
  flash[:notice] = 'this is a notice'
  flash[:something_else] = 'this is something else'
4a79f6a97e31b1d13b239e7f52187674?d=identicon&s=25 Joon You (joonee)
on 2007-03-01 14:17
(Received via mailing list)
If you look at the code generated by the scaffold, you'll notice that
flash[:notice] in methods and corresponding views.  When you change
to :message, you have to change both views/layouts and controllers.

On Mar 1, 7:52 am, Sharma Chelluri <>
2ac70084b87876db2d5875341e57e283?d=identicon&s=25 David Dumaresq (Guest)
on 2007-03-01 17:42
(Received via mailing list)
It might also be worth mentioning that flash by default has the special
property of making the hash available to the next action only (e.g.
flash[:notice]='Item was moved to the trash'). After that it is removed
from the session. Check out flash.keep,, and flash.discard in
the API docs.

Information and Educational Technology
Kwantlen University College - 604-599-2120
"So powerful is the light of unity that it can illuminate the whole
earth." --Bahá'u'lláh
This topic is locked and can not be replied to.