title: rails 3.2.8 validation errors not showing in view
body: <p>Can’t figure out how to get validation errors to show in create or edit views.</p>
  
  <p>In my model I have:</p>
  
  <pre><code> class Person &lt; ActiveRecord::Base
     attr_accessible :first_name, :last_name
  
   belongs_to :organization
  
     validates_presence_of :first_name,  :message =&gt; "First name can't be blank"
     validates_presence_of :last_name,  :message =&gt; "Last name can't be blank"
  </code></pre>
  
  <p>In my Controller I have</p>
  
  <pre><code>def update
      @person = Person.find(params[:id])
          if @person.update_attributes(params[:person])
         redirect_to(:action =&gt; 'list')
      else
        render('edit')
      end
    end
  </code></pre>
  
  <p>In my view I have</p>
  
  <pre><code>&lt;div&gt;
  &lt;%= form_for(:person, :url =&gt; {:action =&gt; 'update', :id =&gt; @person.id}) do |f| %&gt;
  &lt;%= f.errors %&gt;
  
  &lt;table&gt;
  
      &lt;tr&gt;
          &lt;th&gt;First Name:&lt;/th&gt;
          &lt;td&gt;&lt;%= f.text_field(:first_name) %&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;th&gt;Last Name:&lt;/th&gt;
          &lt;td&gt;&lt;%= f.text_field(:last_name) %&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
      &lt;div&gt;
      &lt;%= submit_tag("Update Person") %&gt;
         &lt;/div&gt;
  &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I test validations in my browser by leaving first name field blank, it doesn’t save the record and redirects to edit but does not display any validation errors. However, when I try it out in the console using:</p>
  
  <pre><code>f = Person.find(1)
  #returns record
  f.first_name = “”
  #returns “”
  f.save
  #returns false 
  f.errors
  #returns @message = (:first_name =&gt; [“First name can't be blank”])
  </code></pre>
  
  <p>so it works in the console but not the browser. What am I doing wrong?</p>