(Rails 1.1, Ruby 1.8.4)
In the layout for one of my controllers, I have a tag to display a flash
message (copied from AWDWR), like this:
<div id="data"> <% if @flash[:notice] -%> <div id="notice"><%= @flash[:notice] %></div> <% end -%> <%= @content_for_layout %> </div>
If the controller sets the message, it is displayed as expected: so far
But if I then navigate to a different action of the same controller, the
flash isn’t cleared, where I thought it was supposed to be cleared out
automatically when the current rendering was complete. On the second
subsequent call to the same controller it does disappear.
If I clear it manually after displaying it, as follows, then all is
<% @flash[:notice] = nil; end -%>
So I have a work-around, but can anyone help me understand what is going
on: am I doing something wrong, or misunderstanding how the flash is
meant to work?
Thanks in advance