Skip to content

Instantly share code, notes, and snippets.

Created October 5, 2013 02:16
Show Gist options
  • Save anonymous/6835797 to your computer and use it in GitHub Desktop.
Save anonymous/6835797 to your computer and use it in GitHub Desktop.
We need more counts in the house
// For more information see: http://emberjs.com/guides/routing/
App.Router.map(function() {
this.resource('plan', function() {
this.resource('projects', function() {
this.resource('project', {path: ':project_id'})
});
});
});
App.ProjectsRoute = Ember.Route.extend({
model: function() {
return this.modelFor('plan');
}
});
App.PlanRoute = Ember.Route.extend({
model: function() {
return this.get('store').findAll('project');
},
setupController: function(controller, model) {
controller.set('projectsCount', model.get('length'));
controller.set('model', model);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment