When saving a model instance some values are not getting submitted to
the server. If the comments array is empty no comments param is sent.
How can I change this?
Todo = can.Model.extend({ findAll: 'GET /todos.json', findOne: 'GET /todos/{id}.json', create: 'POST /todos.json', update: 'PUT /todos/{id}.json', destroy: 'DELETE /todos/{id}.json' },{}); var todo = Todo({id: 5});
// {id: 5, comments: ["7654"]}
todo.attr("comments").pop();
// {id: 5, comments: []}
todo.save();
Looking over the wire no comments property was submitted.
Todo = can.Model.extend({ findAll: 'GET /todos.json', findOne: 'GET /todos/{id}.json', create: 'POST /todos.json', update: 'PUT /todos/{id}.json', destroy: 'DELETE /todos/{id}.json' },{}); var todo = Todo({id: 5});
// {id: 5, comments: ["7654"]}
todo.attr("comments").pop();
// {id: 5, comments: []}
todo.save();
Looking over the wire no comments property was submitted.