Skip to content

Instantly share code, notes, and snippets.

@trianglegrrl
Last active December 22, 2015 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save trianglegrrl/6543387 to your computer and use it in GitHub Desktop.
Save trianglegrrl/6543387 to your computer and use it in GitHub Desktop.
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