My model is as follows:
window.List = Backbone.Model.extend({ title: null, idAttribute : '_id', url : function() { return "/list/" + this.id + ".json"; } });
I configure my api to react differently in order to respond more to formats. This works great for retrieving an existing entry, but when it tries to create a new one, it explicitly tries to send a message to / list / undefined.json. Is there a way I can tell if the model is new and will be saved for the first time, or would it be better to think, maybe take a look at the body of the request to determine if it is text / json?
James source share