-
-
Save twetzel/2953744 to your computer and use it in GitHub Desktop.
Spine Substack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Root extends Spine.Stack | |
controllers: | |
resources: App.Resources | |
users: App.Users | |
routes: | |
'/resources' : 'resources' | |
'/users' : 'users' | |
default: 'users' | |
className: 'stack root' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.Users extends Spine.SubStack | |
controllers: | |
search : Search | |
show : Show | |
profile : Profile | |
routes: | |
'/users/search' : 'search' | |
'/users/search?q=:query' : 'search' | |
'/users/profile' : 'profile' | |
'/users/:id' : 'show' | |
default: 'search' | |
className: 'stack users' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Spine.SubStack extends Spine.Stack | |
constructor: -> | |
for key,value of @routes | |
do (key,value) => | |
@routes[key] = => | |
@active() | |
@[value].active(arguments...) | |
super |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment