Ember data send data to the server with the model name embedded.
{
"part" {
"name" : "test1",
"quantity" : 12
}
}
I want the "part" field removed from the response so it would look like:
{
"name" : "test1",
"quantity" : 12
}
I need this to be generic so it will work for any model in my store.
ok I found the part that does in RESTAdapter.
serializeIntoHash: function(data, type, record, options) {
var root = underscore(decamelize(type.typeKey));
data[root] = this.serialize(record, options);
},
I tried to remove the root part
serializeIntoHash: function(data, type, record, options) {
data = this.serialize(record, options);
}
But it does not work, it response with {}