Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Created August 10, 2012 15:36
Show Gist options
  • Save jcoyne/3315096 to your computer and use it in GitHub Desktop.
Save jcoyne/3315096 to your computer and use it in GitHub Desktop.
App.Router = Ember.Router.extend({
location: 'hash',
root: Ember.Route.extend({
index: Ember.Route.extend({
route: '/',
}),
nodes: Ember.Route.extend({
route: '/nodes/new/:fileBinding',
deserialize: function(router, params) {
return App.Node.createRecord({binding: params.fileBinding})
},
serialize: function(router, node) {
return {fileBinding: node.get('binding')}
},
connectOutlets: function(router, node) {
router.get('applicationController').connectOutlet('node', node);
}
}),
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment