mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-15 01:47:55 -05:00
Pass options through to toJSON
This is useful if you have overriden toJSON with own implemention and need to pass some options through
This commit is contained in:
@@ -1381,7 +1381,7 @@
|
||||
// Ensure that we have the appropriate request data.
|
||||
if (!options.data && model && (method === 'create' || method === 'update')) {
|
||||
params.contentType = 'application/json';
|
||||
params.data = JSON.stringify(model);
|
||||
params.data = JSON.stringify(model.toJSON(options));
|
||||
}
|
||||
|
||||
// For older servers, emulate JSON by encoding the request into an HTML-form.
|
||||
|
||||
Reference in New Issue
Block a user