title: Rails 3.2 app: undefined method `klass' for nil:NilClass for a Class that exists and renders on page just fine
body: <p>I am running a pretty straight forward Rails 3.2 app on Dreamhost (I know its lame). </p>
  
  <p>The error is: </p>
  
  <pre><code>NoMethodError in Products#edit
  
  Showing /home/emeraldcityguitars/emeraldcityguitars.com/releases/20120318040051/app/views/products/edit.html.erb where line #47 raised:
  
  undefined method `klass' for nil:NilClass
  Extracted source (around line #47):
  
  44:   &lt;div id="interior_sub_head"&gt;&lt;h5 id="sub_green_head"&gt;&lt;%= @product.title %&gt;&lt;/h5&gt;&lt;/div&gt;
  45:   &lt;div id="interior_pad"&gt;
  46: 
  47:     &lt;%= nested_form_for @product, :html =&gt; { :multipart =&gt; true } do |f| %&gt;
  48:     &lt;%= f.error_messages %&gt;
  49: 
  50:     &lt;fieldset&gt;  
  </code></pre>
  
  <p>It sounds like @product is returning nil, but if you look at line 44, it didn't error when requesting @product in that case?</p>
  
  <p>any ideas?</p>
  
  <p>EDIT</p>
  
  <p>Full Product#edit view: <a href="https://gist.github.com/2081340" rel="nofollow">https://gist.github.com/2081340</a></p>
  
  <p>+</p>
  
  <p>_photo_fields.html view: <a href="https://gist.github.com/5af2f88f29c21e24b42c" rel="nofollow">https://gist.github.com/5af2f88f29c21e24b42c</a></p>
  
  <p>Thanks</p>