Deprecated @flash Warnings
By chris on March 28th 2007 in /dev/rails | 501 views
I keep getting this deprecation warning:
DEPRECATION WARNING: @flash is deprecated! Call flash.[] instead of @flash.[].
which would be reasonable except that the code triggering it is this:
RUBY:
-
<% for name in [:message, :error] %>
-
<% if flash[name] %>
-
<div id="flash" class="alert <%= name.to_s %>"><%= h( flash[name] ) %></div>
-
<% end %>
-
<% end %>
Something's not sitting right with the @flash deprecation warning.

bugeats responded on 02 Jul 2007 at 4:16 pm #
I have this same problem. Annoys the hell out of me. Ever find a fix?
chris responded on 02 Jul 2007 at 9:50 pm #
Nope, not yet. Mostly I’ve just been ignoring them until I stumble across some docs explaining it.
Dmitry Sabanin responded on 10 Jul 2007 at 4:20 pm #
Don’t name your flash partial “_flash.rhtml”, name it something else, like “_flash_box.rhtml”. This is a known bug.
chris responded on 10 Jul 2007 at 4:28 pm #
Dmitry, thanks! Solved it perfectly.
Binary Code » Solving the Depricated @Flash Warning responded on 10 Jul 2007 at 4:32 pm #
[...] long ago I ran into an issue in which my use of flash always generated a warning, though I thought I was implementing it [...]