Skip to content

Instantly share code, notes, and snippets.

@jakehow
Created May 24, 2012 20:33
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 jakehow/41547193a6219710a3e5 to your computer and use it in GitHub Desktop.
Save jakehow/41547193a6219710a3e5 to your computer and use it in GitHub Desktop.
Simple Router Example
App.Router = Ember.Router.extend
location: 'hash'
enableLogging: true
rootElement: '#app'
start: Ember.State.extend
index: Ember.State.extend
route: '/'
ready: (manager) ->
manager.transitionTo('splash')
splash: Ember.ViewState.extend
route: '/splash'
view: App.SplashView
about: Ember.ViewState.extend
route: '/about'
view: App.AboutView
@mikegrassotti
Copy link

Been looking into this some more. Not sure if we're having same problem, but here's what I found out:

  • I was working off 1.0 HEAD, but routing is now merged down to master. Would advice using that as well if you aren't already
  • Big thing I was missing was call to App.initialize(), which sets App.stateManager to an instance of App.Router
  • There's another routing example here: https://gist.github.com/2788545 - close to what you'd written but the syntax is evolving. That gist works for me.

Seems like routing is changing every few hours....

Ember routing is changing crazy fast right now, so stuff that works

@jakehow
Copy link
Author

jakehow commented May 25, 2012

@grasscode thanks for commenting. I am running off of head and setup just like the other gist. Still cannot get route to work as I expect though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment