Skip to content

Instantly share code, notes, and snippets.

@fellix
Created July 19, 2011 13:12
backbone sample
window.Album = Backbone.Model.extend({
url: function(){
return this.id ? '/collection/'+this.album_collection_id+'/album/'+this.id : '/collection/'+this.album_collection_id+'/albums';
},
defaults: { album: {
album_collection_id: 0,
title: "nothing",
artist: "nobody",
image: "",
price: 0.0,
url: "www.google.com"
} },
initialize: function(){
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment