Deprecated @flash Warnings

   By chris on March 28th 2007 in /dev/rails | 678 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:
  1. <% for name in [:message, :error] %>
  2.     <% if flash[name] %>
  3.         <div id="flash" class="alert <%= name.to_s %>"><%= h( flash[name] ) %></div>
  4.     <% end %>
  5. <% end %>

Something's not sitting right with the @flash deprecation warning.

5 Responses to “Deprecated @flash Warnings”

  1. 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?

  2. 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.

  3. 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.

  4. chris responded on 10 Jul 2007 at 4:28 pm #

    Dmitry, thanks! Solved it perfectly.

  5. 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 [...]

Trackback URI | Comments RSS

Leave a Reply