This is my model.
library.BookModel = Backbone.Model.extend({ urlRoot: '/api/books', defaults: { id : null, imageurl: 'noimage.jpg', } }); I'm trying to issue a delete request by calling book.destroy. But it is not triggering the request. When the app is initialized. The model is populated with data from server. There are two IDs attributes set in the model. id(client side id) and _id(mongodb id). I initialized the client side id as book.attributes.id = book.attributes._id in model initialize function. So Everything is set. But i can't seem to initiate the delete request. please tell me where I'm going wrong. Am I missing anything here?
my backend router is defined as such to handle delete request.
app.delete('/api/books/:id', function(req, res){...});