Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created January 10, 2011 18:31
Show Gist options
  • Save gmoeck/773204 to your computer and use it in GitHub Desktop.
Save gmoeck/773204 to your computer and use it in GitHub Desktop.
Todos.tasksController = SC.ArrayController.create({
countSummary: function() {
var length = this.get('length');
if(length == 0)
return 'No Tasks';
else
return length == 1 ? '1 Task' : "%@ Tasks".fmt(length);
}.property('length').cacheable(),
addTask: function() {
Todos.store.createRecord(Todos.Task, { "description": "New Task", "isDone": false }); // ADDED THIS
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment