title: Rails 3 link_to delete destory method calls show method?
body: <p>Hey I have seen several posts on this, but I am still having issues with calling :method => 'delete' and getting directed to the show method of my controller. The destroy method is working as expect, in that it deletes the comment, but after the request is done, it throws a 404 on GET. Here is the code:</p>
  
  <pre><code>&lt;%= link_to 'delete', "/events/#{@event.id}/comments/#{comment.id}.js", 
          :confirm =&gt; 'Are you sure?', 
          :method =&gt; :delete, 
          :remote =&gt; true %&gt;
  </code></pre>
  
  <p>Here is the controller method:</p>
  
  <pre><code>def destroy 
    @comment = @event.comments.find(params[:id])
    @comment.destroy
    redirect_to do |format|
      format.html # redirect_to @event, :notice =&gt; "comment deleted" }
      format.js { render 'destroy.js.erb' }
    end
  end
  </code></pre>
  
  <p>I've hear that this could be due to not using button_to, but I have tried using button_to as opposed to link_to but this does the same thing. </p>
  
  <p>I've also heard that this could be do to some problems with the way you are using jquery in your set up, but I feel like I doubt that, but here is how I call in jquery just in case (application.html.erb):</p>
  
  <pre><code>&lt;%= javascript_include_tag 'jquery-1.5.2.min.js', 'rails', 'application' %&gt;
    &lt;%= javascript_include_tag 'jquery-ui-1.8.17.custom.min.js' %&gt;
  </code></pre>
  
  <p>When i watch rails server output I see that it's says:</p>
  
  <pre><code>Redirected to http://0.0.0.0:3000/events/1/comments/35
  Completed 302 Found in 132ms
  ACTION NAME application
  
  
  Started GET "/events/1/comments/35" for 127.0.0.1 at Wed Feb 08 16:31:43 -0800 2012
  
  AbstractController::ActionNotFound (The action 'show' could not be found for CommentsController):
  </code></pre>
  
  <p>Thanks for the help!</p>