Skip to content

Instantly share code, notes, and snippets.

@somebody32
Created August 19, 2013 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somebody32/6271687 to your computer and use it in GitHub Desktop.
Save somebody32/6271687 to your computer and use it in GitHub Desktop.
App.ApplicationRoute = Ember.Route.extend
setupController: (controller) ->
do @getCurrentUser
getCurrentUser: ->
App.Auth.send
url: "/user",
success: (data) =>
@controller.set('currentUser', App.User.create(data));
App.ChildRoute = Ember.Route.extend
setupController: (controller) ->
console.log @controllerFor('application').get('currentUser').get('name')
App.User = Ember.Object.extend()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment