title: undefined method model_name
body: <p>I'm using the default code created by scaffolding. I haven't changed anything.</p>
  
  <pre><code>Showing app/views/presences/_form.html.erb where line #1 raised: 
  undefined method `model_name' for NilClass:Class
  
  1: &lt;%= form_for(@presence) do |f| %&gt;
  2:   &lt;% if @presence.errors.any? %&gt;
  3:     &lt;div id="error_explanation"&gt;
  4:       &lt;h2&gt;&lt;%= pluralize(@presence.errors.count, "error") %&gt; prohibited this presence from being saved:&lt;/h2&gt;
  </code></pre>
  
  <p>What is wrong here? I'm never calling a method called "model_name" and this code is automated, so why doesn't it work?</p>
  
  <p>Thanks</p>