This code from example in docs:
-
Recipe = can.Model.extend({
destroy : "DELETE /collection/{id}",
findOne : "GET /collection/{id}"
},{});
Recipe.bind("destroyed", function(){
console.log("a recipe destroyed");
});
Recipe.findOne({id: 105}, function(recipe){
recipe.bind("destroyed", function(){
console.log("this recipe destroyed");
});
recipe.destroy();
});
Send only GET query to my RESTful API and both events are fire. But destroy is not work. Console log:
- GET
http://localhost/collection/105this recipe destroyeda recipe destroyed