Skip to content

Instantly share code, notes, and snippets.

@psykidellic
Created August 8, 2012 04:59
Show Gist options
  • Select an option

  • Save psykidellic/3292208 to your computer and use it in GitHub Desktop.

Select an option

Save psykidellic/3292208 to your computer and use it in GitHub Desktop.
var AppRouter = Backbone.Router.extend({
routes:{
"":"index",
"test": function() {
console.log("Test method");
},
"foo": function() {
console.log("Foo method");
},
"bar": function() {
console.log("Bar method");
}
},
index:function () {
console.log('To index');
}
});
...
var router = new AppRouter();
Backbone.history.start({pushState: true});
...
#test-links
%a{ :href => '#test'} Test
%a{ :href => '#foo'} Foo
%a{ :href => '#bar'} Bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment