Skip to content

Instantly share code, notes, and snippets.

@marceloverdijk
Created January 24, 2012 20:39
Show Gist options
  • Save marceloverdijk/1672431 to your computer and use it in GitHub Desktop.
Save marceloverdijk/1672431 to your computer and use it in GitHub Desktop.
define [
'jquery'
'use!backbone'
], ($, Backbone, CustomerListView) ->
class Router extends Backbone.Router
routes: {
'': 'customerListPage'
'/': 'customerListPage'
'customerListPage': 'customerListPage'
'customerDetailsPage?id=:id': 'customerDetailsPage'
}
customerListPage: ->
console.log 'routing to customer list page'
customerDetailsPage: (id) ->
console.log 'routing to customer details page with id ' + id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment