title: Rails, losing flash after redirect_to
body: <p>I can't figure out why my flash messages disappear after a redirect_to. Started the debugger in my view, and the flash variable is totally empty. </p>
  
  <pre><code>flash
  =&gt; {}
  </code></pre>
  
  <p>The result is the same with flash.now... It works fine if I edit something and call render.</p>
  
  <p>Controller:</p>
  
  <pre><code>  def create
      @user_session = UserSession.new(params[:user_session])
      if @user_session.save
        flash[:notice] = "Logged in"
        redirect_to root_url
      else
        render :action =&gt; 'new'
      end
    end
  </code></pre>
  
  <p>Application layout:</p>
  
  <pre><code>  - flash.each do |name, msg|
      =content_tag :div, msg, :class =&gt; "flash_#{name}"
  </code></pre>
  
  <p>root_url is another controller and action.</p>