title: undefined method `destroy' for nil:NilClass
body: <p>My app successfully creates rows for a table every time a user submits some stats. Now I want to provide a delete button to be able to delete some rows. </p>
  
  <p>When I click the delete button I get the error: </p>
  
  <pre><code>undefined method `destroy' for nil:NilClass
  </code></pre>
  
  <p>Seems like either rails doesn't understand the destroy method in this case for whatever reason, or rails doesn't see anything to destroy, hence the nil:NilClass. </p>
  
  <p>My first question is in identifying which is the case, if either of those. </p>
  
  <p>My second question is fixing it :D</p>
  
  <p>Here's my show.html:</p>
  
  <pre><code>&lt;% provide(:title, "Log" ) %&gt;
  &lt;% provide(:heading, "Your Progress Log") %&gt;
  
  &lt;div class="row"&gt;  
    &lt;div class="span8"&gt;
      &lt;% if @user.status_update.any? %&gt;
        &lt;h3&gt;Status Updates (&lt;%= @user.status_update.count %&gt;)&lt;/h3&gt;    
        &lt;table&gt;
          &lt;thead&gt;
            &lt;tr&gt;
              &lt;th&gt;Entry Date&lt;/th&gt;
              &lt;th&gt;Weight&lt;/th&gt;
              &lt;th&gt;BF %&lt;/th&gt;
              &lt;th&gt;LBM&lt;/th&gt;
              &lt;th&gt;Fat&lt;/th&gt;
              &lt;th&gt;Weight Change&lt;/th&gt;
              &lt;th&gt;BF % Change&lt;/th&gt;
              &lt;th&gt;Fat Change&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
        &lt;tbody class = "status updates"&gt;
            &lt;%= render @status_updates %&gt;
        &lt;/tbody&gt;        
      &lt;% end %&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The "&lt;%= render @status_updates %>" calls the _status_update partial. </p>
  
  <pre><code> &lt;tr&gt;
   .
   .
   .
   . 
   &lt;% if current_user==(status_update.user) %&gt; 
   &lt;td&gt;
         &lt;%= link_to "delete", status_update, method: :delete %&gt;
  
   &lt;/td&gt;
   &lt;%  end  %&gt;         
  
  &lt;/tr&gt;                                    
  </code></pre>
  
  <p>And then finally, here is the StatusUpdateController</p>
  
  <pre><code>def destroy
      @status_update.destroy
      redirect_to root_url
  end
  </code></pre>
  
  <p>Here are the parameters on the error page:</p>
  
  <pre><code>{"_method"=&gt;"delete",
   "authenticity_token"=&gt;"w9eYIUEd2taghvzlo7p3uw0vdOZIVsZ1zYIBxgfBymw=",
   "id"=&gt;"106"}
  </code></pre>