Skip to content

Instantly share code, notes, and snippets.

@Samsinite
Created November 7, 2014 10:05
Show Gist options
  • Save Samsinite/845b414cf45b5653cf0e to your computer and use it in GitHub Desktop.
Save Samsinite/845b414cf45b5653cf0e to your computer and use it in GitHub Desktop.
Ember Data array extraction customization example
DS.RESTSerializer.extend({
extractArray: function(store, type, payload) {
var inflector = Ember.Inflector.inflector,
data = payload || [],
modifiedPayload = {};
modifiedPayload[inflector.pluralize(type.typeKey)] = data;
return this._super(store, type, modifiedPayload);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment