Skip to content

Instantly share code, notes, and snippets.

@hgezim hgezim/gist:4053581

Created Nov 11, 2012
What would you like to do?
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')
this.navigate ''
list: (list_id) ->
Session.set('page', 'list')
Session.set("list_id", list_id)
this.navigate list_id, true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.