Skip to content

Instantly share code, notes, and snippets.

@dirkkelly
Created October 7, 2011 02:56
Show Gist options
  • Save dirkkelly/1269330 to your computer and use it in GitHub Desktop.
Save dirkkelly/1269330 to your computer and use it in GitHub Desktop.
Spine.js Mobile Routing (http://spinejs.com/docs/routing)
Uncaught Unknown record
Model.find
ProfilesShow.active
__bind
Profiles.routes./profiles/:id
Module.proxy
__bind
Spine.Route.Route.match
Spine.Route.Route.matchRoute
Spine.Route.Route.navigate
Spine.Controller.include.navigate
UsersNew.active
__bind
Users.routes./users/new
Module.proxy
__bind
Spine.Route.Route.match
Spine.Route.Route.matchRoute
Spine.Route.Route.navigate
Spine.Controller.include.navigate
App
(anonymous function):9294/:13
jQuery.extend._Deferred.deferred.resolveWith
jQuery.extend.ready
DOMContentLoaded
class App extends Stage.Global
constructor: ->
super
@profiles = new Profiles
Spine.Route.setup()
@navigate '/profiles/new'
class ProfilesNew extends Panel
constructor: ->
super
...
active: =>
...
@render()
class ProfilesShow extends Panel
constructor: ->
super
...
active: =>
...
@profile = Profile.find(params.id)
@render()
class Profiles extends Spine.Controller
constructor: ->
super
@newProfile = new ProfilesNew
@showProfile = new ProfilesShow
@routes
'/profiles/new': (params) -> @newProfile.active(params)
'/profiles/:id': (params) -> @showProfile.active(params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment