Contacts.ContactModel = Backbone.Model.extend({
defaults: {
id: null,
firstname: "",
lastname: ""
},
url: function (type) {
if (type == "DELETE")
return "Contacts/Contact/delete/" + this.get('id');
return this.isNew() ? "Contacts/Contact/create" : "Contacts/Contact/update";
}
});
e.g.: Contacts/Contact/create should be modified as Contact/create. On the other hand the sample doesn't work well.