Skip to content

Instantly share code, notes, and snippets.

@hgezim
Created November 11, 2012 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hgezim/4053581 to your computer and use it in GitHub Desktop.
Save hgezim/4053581 to your computer and use it in GitHub Desktop.
TeamDoListRouter = Backbone.Router.extend
initialize: (options) ->
# IMPORTANT: These get matched in the reverse order that they show up
@route(/\?*/, "home") #Match / followed by a question mark or 0 question marks
@route(/([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})/, "list") # Match a GUID
home: () ->
Session.set('page', 'home')
initHome()
this.navigate ''
list: (list_id) ->
Session.set('page', 'list')
Session.set("list_id", list_id)
initList()
this.navigate list_id, true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment