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
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] -%>
<div class="error" id="error"><%= flash[:error]%></div>
<% end -%>
<% if flash[:notice] -%>
<div class="notice" id="notice"><%= flash[:notice] %></div>
<script type="text/javascript">new Effect.Highlight('notice',
{duration: 2.0});</script>
<% end -%>
A grep for @flash in my project finds nothing (performed from the
project root, so includes searching the plugins).
Any ideas?
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 http://www.rubyonrails.org/deprecation
> for details. (called from
> _run_rhtml_47app47views47shared47_flash46rhtml at
> /Users/evansj/rails/config/../app/views/shared/_flash.rhtml:1)
--
Posted via http://www.ruby-forum.com/.
On Jan 22, 8:15 pm, Tom De grunt <rails-mailing-l...@andreas-s.net>
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).
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
On Jan 22, 3:15 pm, Tom De grunt <rails-mailing-l...@andreas-s.net>
wrote:
> 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] Seehttp://www.rubyonrails.org/deprecation