Skip to content

Instantly share code, notes, and snippets.

@dunkfordyce
Created October 19, 2011 17:46
Show Gist options
  • Save dunkfordyce/1299082 to your computer and use it in GitHub Desktop.
Save dunkfordyce/1299082 to your computer and use it in GitHub Desktop.
// this works
Router = new Backbone.Router({
routes: {
'': 'accounts',
'accounts/:account_id': 'accounts',
'accounts/:account_id/campaigns': 'accounts',
'accounts/:account_id/campaigns/:campaign_id': 'accounts'
},
accounts: function() {
console.log('accounts', arguments);
}
});
// but the docs say it should be:
Router = new Backbone.Router.extend({
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment