Don't send up model data for GET requests by default, for folks who are re-fetching existing collections.

This commit is contained in:
Jeremy Ashkenas
2010-10-16 16:05:49 -04:00
parent 7b10698af6
commit 5c5b7a8824

View File

@@ -603,10 +603,11 @@
// * Persist models via WebSockets instead of Ajax.
//
Backbone.sync = function(method, model, success, error) {
var data = method === 'read' ? {} : {model : JSON.stringify(model)};
$.ajax({
url : getUrl(model),
type : methodMap[method],
data : {model : JSON.stringify(model)},
data : data,
dataType : 'json',
success : success,
error : error