title: Errors creating a button to delete an active record
body: <p>Having trouble deleting an active record for my model of workers.</p>
  
  <p>Workers has a belongs_to relationship with Users</p>
  
  <p>My routes</p>
  
  <pre><code>workers_update PUT    /workers/update(.:format)                  workers#update
  user_workers POST   /users/:user_id/workers(.:format)          workers#create
  new_user_worker GET    /users/:user_id/workers/new(.:format)      workers#new
  edit_user_worker GET    /users/:user_id/workers/:id/edit(.:format) workers#edit
  user_worker GET    /users/:user_id/workers/:id(.:format)      workers#show
               DELETE /users/:user_id/workers/:id(.:format)      workers#destroy
  </code></pre>
  
  <p>My worker controller destroy method</p>
  
  <pre><code>    def destroy
       @worker.destroy
       redirect_to(current_user) 
     end
  </code></pre>
  
  <p>The button I'm trying to create which is on the worker show page</p>
  
  <pre><code>&lt;% if current_user?(@worker.user) %&gt;
     &lt;%= button_to "Delete", @worker, method: :delete, data: {confirm: "Are you sure you  want to delete this worker?"}%&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>The error I get when I try and load the page</p>
  
  <pre><code> NoMethodError in Workers#show
  
   Showing /home/elliot/rails_projects/EJWmining_app/mining_app/app/views/workers/show.html.erb where line #10 raised:
  
   undefined method `worker_path' for #&lt;#&lt;Class:0x00000002b841e0&gt;:0x00000003e5e338&gt;
  
   Extracted source (around line #10):
  
   9: &lt;% if current_user?(@worker.user) %&gt;
   10:     &lt;%= button_to "Delete", @worker, method: :delete, data: {confirm: "Are you sure you want to delete this worker?"}%&gt;
   11: &lt;%end%&gt;
  </code></pre>
  
  <p>Not sure why I am getting this error. it says no method error in Workers#show it should be calling Workers#destroy. Bonus points we can add my bootstrap button class to this button</p>
  
  <pre><code>class: "btn btn-small bit-danger"
  </code></pre>