Skip to content

Instantly share code, notes, and snippets.

@stephanos
Last active December 10, 2015 13:59
Show Gist options
  • Save stephanos/4444947 to your computer and use it in GitHub Desktop.
Save stephanos/4444947 to your computer and use it in GitHub Desktop.
App.Router.map (match) ->
(match "/user").to "user", (match) ->
(match "/").to "userIdx"
(match "/settings").to "userSetup", (match) ->
(match "/").to "userSetupIdx"
(match "/profile").to "userSetupProf"
(match "/password").to "userSetupPass"
#######################################################################################
# /user/
# =====================================================================================
App.UserIdxRoute =
Em.Route.extend
redirect: ->
@transitionTo "userSetupIdx"
# /user/settings
# =====================================================================================
App.UserSetupRoute =
Em.Route.extend
redirect: ->
@transitionTo "userSetupIdx"
# /user/settings/
# =====================================================================================
App.UserSetupIdxRoute =
Em.Route.extend
redirect: ->
@transitionTo "userSetupProf"
# /user/settings/profile
# =====================================================================================
App.UserSetupProfRoute =
Em.Route.extend()
# /user/settings/password
# =====================================================================================
App.UserSetupPassRoute =
Em.Route.extend()
#######################################################################################
Where to render the following template "userSetup"? How to connect the {{outlet}}?
<div class='sidebar'>
...
</div>
<div class='main'>
{{outlet}}
</div>
App.UserSetupView =
Em.View.extend
elementId: "userSetupBox"
classNames: ["box", "navi-box", "setup-box"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment