Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.