Skip to content Skip to sidebar Skip to footer

How To Exclude An Object's Id Property Before Or During $.tojson

I'm writing a custom REST adapter for ember-data users with a django rest framework app and need to build a JSON string to do POST/PUT. The only problem is I can't seem to chain an

Solution 1:

Turns out this was really simple

var json_data = record.toJSON();
delete json_data.id;
var data = $.param(json_data);

Now instead of

id=0&username=dat

I now get

username=dat

Post a Comment for "How To Exclude An Object's Id Property Before Or During $.tojson"