title: undefined local variable or method `object' for error_messages.html
body: <p>I'm following the ruby on rails tutorial. And I received a error on my signup page only.</p>
  
  <pre><code>undefined local variable or method `object' for #&lt;#&lt;Class:0x007feb442f6a98&gt;:0x007feb442f8438&gt;
  </code></pre>
  
  <p>Extracted source (around line #1):</p>
  
  <pre><code>1: &lt;% if object.errors.any? %&gt;
  2:  &lt;div id="error_explanation"&gt;
  3:      &lt;h2&gt;
  4:          &lt;%= pluralize(object.errors.count, "error") %&gt;
  </code></pre>
  
  <p>Here's my error_messages file.</p>
  
  <pre><code>&lt;% if object.errors.any? %&gt;
      &lt;div id="error_explanation"&gt;
          &lt;h2&gt;
              &lt;%= pluralize(object.errors.count, "error") %&gt;
              prohibited this &lt;%= object.class.to_s.underscore.humanize.downcase %&gt; from being saved:
              &lt;/h2&gt;
              &lt;p&gt;There were problems with the following fields:&lt;/p&gt;
              &lt;ul&gt;
              &lt;% object.errors.full_messages.each do |message| %&gt;
              &lt;li&gt;&lt;%= message %&gt;&lt;/li&gt;
              &lt;% end %&gt;
              &lt;/ul&gt;
      &lt;/div&gt;
  
      &lt;% end %&gt;
  </code></pre>
  
  <p>Now here's my users/new.html file.</p>
  
  <pre><code>&lt;h1&gt;Sign up&lt;/h1&gt;
  
  &lt;%= form_for(@user) do |f| %&gt;
  &lt;%= render 'shared/error_messages', :object =&gt; f.object %&gt;
  &lt;%= render 'fields', :f =&gt; f %&gt;
  &lt;div class="actions"&gt;
  &lt;%= f.submit "Sign up" %&gt;
  &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>