# Bug in @flash deprecation?

**URL:** <https://www.ruby-forum.com/t/bug-in-flash-deprecation/82926>\
**Category:** Rails\
**Created:** [January 22, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/bug-in-flash-deprecation/82926 "2007-01-22T14:42:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Evans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@Jon\_Evans](https://www.ruby-forum.com/u/Jon_Evans)\
**Post date:** [January 22, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/bug-in-flash-deprecation/82926/1 "2007-01-22T14:42:53Z")

</div>

Hi,

I’m getting a warning about @flash since updating to Rails 1.2.1, but  
as far as I can tell I’m not using @flash.

Warning is:

DEPRECATION WARNING: @flash is deprecated! Call flash.[] instead of  
@flash.[]. Args: [:error] See [http://www.rubyonrails.org/deprecation](http://www.rubyonrails.org/deprecation)  
for details. (called from  
\_run\_rhtml\_47app47views47shared47\_flash46rhtml at  
/Users/evansj/rails/config/…/app/views/shared/\_flash.rhtml:1)

plus another identical message for arg :notice at \_flash.rhtml:4

\_flash.rhtml just contains this:

\<% if flash[:error] -%\>

\<%= flash[:error]%\>
\<% end -%\> \<% if flash[:notice] -%\>
\<%= flash[:notice] %\>
\<% end -%\>

A grep for @flash in my project finds nothing (performed from the  
project root, so includes searching the plugins).

Any ideas?

Jon

---

<div class="post-metadata">

**Author:** ![Jon\_Evans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@Jon\_Evans](https://www.ruby-forum.com/u/Jon_Evans)\
**Post date:** [January 22, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/bug-in-flash-deprecation/82926/2 "2007-01-22T21:15:46Z")

</div>

Jon,

I had the same thing, I think I have isolated the problem and what I  
found is that if you have a partial called \_flash.rhtml and put one  
reference to flash (f.e. \<%= flash[:notice] %\>) in there you get this  
warning.

Everything works though and YOU know you don’t have @flash in there, so  
I wouldn’t worry about it too much. I did file a ticket though …

Tom

Jon Evans wrote:

> DEPRECATION WARNING: @flash is deprecated! Call flash.[] instead of  
> @flash.[]. Args: [:error] See [Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.](http://www.rubyonrails.org/deprecation)  
> for details. (called from  
> \_run\_rhtml\_47app47views47shared47\_flash46rhtml at  
> /Users/evansj/rails/config/…/app/views/shared/\_flash.rhtml:1)

---

<div class="post-metadata">

**Author:** ![Jon\_Evans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@Jon\_Evans](https://www.ruby-forum.com/u/Jon_Evans)\
**Post date:** [January 30, 2007, 3:36am UTC](https://www.ruby-forum.com/t/bug-in-flash-deprecation/82926/3 "2007-01-30T03:36:35Z")

</div>

I just wanted to say your not the only ones with this issue. Its not  
a big deal, but a bit annoying…

On Jan 22, 3:15 pm, Tom De grunt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Jon\_Evans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@Jon\_Evans](https://www.ruby-forum.com/u/Jon_Evans)\
**Post date:** [January 23, 2007, 2:25pm UTC](https://www.ruby-forum.com/t/bug-in-flash-deprecation/82926/4 "2007-01-23T14:25:22Z")

</div>

Hi Tom,

On Jan 22, 8:15 pm, Tom De grunt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I had the same thing, I think I have isolated the problem and what I  
> found is that if you have a partial called \_flash.rhtml and put one  
> reference to flash (f.e. \<%= flash[:notice] %\>) in there you get this  
> warning.
> 
> Everything works though and YOU know you don’t have @flash in there, so  
> I wouldn’t worry about it too much. I did file a ticket though …

Thanks, I found your ticket ([http://dev.rubyonrails.org/ticket/7303](http://dev.rubyonrails.org/ticket/7303)).  
There’s a comment there that says you can avoid the warning by using  
self.flash[:notice] in the view code. That seems to fix it.

Jon
