title: Rails flash hash being rendered one request too soon
body: <p>I'm having an issue in Rails 3 where the flash hash seems to be returning things one request too early. That is, it seems to return things upon rendering that were set in that very same request. For example, consider a controller action that does:</p>
  
  <pre><code>    add_warning "Danger, will robinson."
  </code></pre>
  
  <p>In my ApplicationController, I have:</p>
  
  <pre><code>    before_filter :set_errors
      #...
      def set_errors
        flash[:errors] ||= []
        flash[:warnings] ||= []
        flash[:notices] ||= []
      end
      #...
      def add_warning(msg)
        flash[:warnings] &lt;&lt; msg
      end
  </code></pre>
  
  <p>And my application.html.erb layout template has</p>
  
  <pre><code>    &lt;% flash[:warnings].each do |msg| %&gt;
        &lt;div class="warnings"&gt;&lt;%= msg %&gt;&lt;/div&gt;
      &lt;% end %&gt;
  </code></pre>
  
  <p>Based on what I'm understanding from the Rails guide, the flash contents shouldn't be rendered in this same request unless I'm using flash.now. And, if I have a redirect_to, they SHOULD be rendered in that second request. But they don't show up at all when the redirect_to happens.</p>