Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Forked from radar/app.js
Last active December 15, 2015 07:39
Show Gist options
  • Save ahawkins/5225402 to your computer and use it in GitHub Desktop.
Save ahawkins/5225402 to your computer and use it in GitHub Desktop.
App = Ember.Application.create({});
App.Store = DS.Store.extend({
adapter: DS.RESTAdapter.create({
namespace: 'api',
serializer: DS.RESTSerializer.extend({
extractMeta: function(loader, type, json) {
this._super.apply(this, arguments);
delete json.count;
delete json.total_count;
delete json.current_page;
delete json.pages;
}
})
})
})
App.Product = DS.Model.extend({
name: DS.attr('name')
});
App.IndexRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('products', App.Product.find());
}
});
{"count":1,"total_count":1,"current_page":1,"pages":1,"products":[{"id":1,"name":"T-Shirt","description":null,"price":"19.0","available_on":"2013-03-21T22:11:25Z","permalink":"t-shirt","count_on_hand":0,"meta_description":null,"meta_keywords":null,"taxon_ids":[],"variants":[{"id":1,"name":"T-Shirt","count_on_hand":0,"sku":"","price":"19.0","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":null,"permalink":"t-shirt","option_values":[],"images":[]}],"option_types":[],"product_properties":[]}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment