Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Some values not sent when pdating values with a can.Model

$
0
0
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.



Viewing all articles
Browse latest Browse all 3491

Trending Articles