Exactly. "recipe.destroy()" does not send DELETE query.
This can be
seen in the console. There's only
a GET request . In the database there is no
change . Moreover
, making console.log(recipe.destroy()); I
get an empty object .
At the same time , the code below works fine, I get a DELETE request to the server, but , the event does not work again :(
At the same time , the code below works fine, I get a DELETE request to the server, but , the event does not work again :(
-
Recipe = can.Model.extend({
destroy : "DELETE /collection/{id}",
findOne : "GET /collection/{id}"
},{});
Recipe.bind("destroyed", function(){
console.log("a recipe destroyed");
});
Recipe.destroy(125);