Last active
December 22, 2015 22:59
-
-
Save trianglegrrl/6543387 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
CoachApp.IndexRoute = Ember.Route.extend | |
model: (params) -> | |
client_id = localStorage.getItem 'clientId' | |
localStorage.removeItem('clientId') | |
if client_id? and !isNaN(client_id, 10) | |
CoachApp.Client.findById client_id | |
afterModel: (client) -> | |
if client | |
@transitionTo 'client', client | |
else | |
@transitionTo 'clients' | |
renderTemplate:-> | |
name = 'index' | |
name = 'jasmine' if Env.testing | |
@render name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment