Skip to content

Instantly share code, notes, and snippets.

@juzow13
Created December 20, 2013 12:52
Show Gist options
  • Save juzow13/8054426 to your computer and use it in GitHub Desktop.
Save juzow13/8054426 to your computer and use it in GitHub Desktop.
MyCollection = Backbone.Collection.extend({
model:MyModel,
url: "/mymodels",
fetchPerCategory: function (categoryId, options) {
options = options || {};
if (options.url === undefined) {
options.url = "/custom_mymodels/" + categoryId;
}
return Backbone.Model.prototype.fetch.call(this, options);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment