title: jquery doesn't call success method on $.ajax for rails standard REST DELETE answer
body: <p>May be such problem is not new, but I didn't find anything similar. I have such jQuery code: </p>
  
  <pre><code>$.ajax({ 
    url : ('/people/'+id), 
    type : 'DELETE', 
    dataType : 'json', 
    success : function(e) {
      table.getItems(currentPage);
    }
  });
  </code></pre>
  
  <p>My Rails controller looks like this:</p>
  
  <pre><code>def destroy
      @person = Person.find(params[:id])
      @person.destroy
  
      respond_to do |format|
        format.html { redirect_to(people_url) }
        format.json  { render :json =&gt; @person, :status =&gt; :ok }
      end
  end
  </code></pre>
  
  <p>This is working.  </p>
  
  <p>But when I use the following (as generated by standard), the <code>success</code> callback doesn't get called:</p>
  
  <pre><code>def destroy
      @person = Person.find(params[:id])
      @person.destroy
  
      respond_to do |format|
        format.html { redirect_to(people_url) }
        format.json  { head :ok }
      end
  end
  </code></pre>
  
  <p>Tested under <code>rails 3.0.3</code>, <code>jQuery 1.4.2</code> and <code>Firefox 3.6.13</code>.<br>
  Firebug says, that query is fired and returns 200 OK in both cases, item is deleted in both cases too. But in second case the callback is not called.</p>
  
  <p>Is there a significant difference in REST, and is there a way to utilize jQuery by using the scaffolded controller?</p>