title: Flash isn't rendering the model error during a save
body: <p>I don't understand why my flash is not displaying when trying to save a model that contains validation errors.</p>
  
  <p>My controller has this in the create method:</p>
  
  <pre><code>  if @post.save
      redirect_to admin_posts_path
    else
      render 'new'
    end
  </code></pre>
  
  <p>My layout has the following:</p>
  
  <pre><code>&lt;% flash.each do |message_type, message| %&gt;
      &lt;div class="alert alert-&lt;%= message_type %&gt;"&gt;&lt;%= message %&gt;&lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Now if I add a puts statement to output the errors on the post model, I can see them in my logs.</p>
  
  <pre><code>if @post.save
    redirect_to admin_posts_path
  else
    puts "model errors are: #{@post.errors.inspect}"
    render 'new'
  end
  </code></pre>
  
  <blockquote>
    <p>@messages={:title=>["can't be blank"], :body=>["can't be blank"]},
    @details={:title=>[{:error=>:blank}], :body=>[{:error=>:blank}]}></p>
  </blockquote>
  
  <p>Why wouldn't the flash error be displaying when I try and save a post?
  It is clearly not saving, and the errors collection is non-empty.</p>
  
  <p>Doesn't the model's errors get added to the flash automatically?</p>