Skip to content

Instantly share code, notes, and snippets.

@bradleypriest
Forked from Neppord/router.js
Created July 11, 2012 07:40
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 bradleypriest/3088762 to your computer and use it in GitHub Desktop.
Save bradleypriest/3088762 to your computer and use it in GitHub Desktop.
How does the automatic find binding work?
App.Router = Em.Router.extend({
root: Em.Route.extend({
route: '/',
user: Em.Route.extend({
route: '/:user_id/',
connectOutlets: function (router, context) {
//What is context here?
// it's simple in the one segment case where
// its the return value of find on the model.
},
index: Em.Route.extend({
redirectsTo: "post"
}),
post: Em.Route.extend({
route: "/post_id"
})
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment