Skip to content

Instantly share code, notes, and snippets.

@mockra
Created December 27, 2013 04:39
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 mockra/8142655 to your computer and use it in GitHub Desktop.
Save mockra/8142655 to your computer and use it in GitHub Desktop.
App.TodosRoute = Ember.Route.extend({
model: function () {
return this.store.find('todo');
}
});
App.TodosIndexRoute = Ember.Route.extend({
model: function () {
return this.modelFor('todos');
}
});
App.TodosActiveRoute = Ember.Route.extend({
model: function(){
return this.store.filter(App.Todo, function (todo) {
return !todo.get('isCompleted');
});
},
renderTemplate: function(controller){
this.render('todos/index', {controller: controller});
}
});
App.TodosCompletedRoute = Ember.Route.extend({
model: function(){
return this.store.filter(App.Todo, function (todo) {
return todo.get('isCompleted');
});
},
renderTemplate: function(controller){
this.render('todos/index', {controller: controller});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment