Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created December 11, 2012 21:33
Show Gist options
  • Save EdwardIII/4262313 to your computer and use it in GitHub Desktop.
Save EdwardIII/4262313 to your computer and use it in GitHub Desktop.
$(function(){
var Person = Backbone.Model.extend();
var Baskets = Backbone.Collection.extend({
'url': '/api/v1/basket/'
});
var baskets = new Baskets;
baskets.fetch();
var basket = baskets.at(0);
console.dir(baskets);
console.dir(basket);
});
/* Server is returning:
{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 1}, "objects": [{"id": "1", "people": ["/api/v1/person/10/"], "resource_uri": "/api/v1/basket/1/"}]}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment