     @renderTask(task) for task in @tasks.active
     @renderTask(task) for task in @tasks.done
 
-  # Renders a task into the
+  # Renders a task into the list that it belongs to.
   renderTask: (task) ->
     $list = if task.done then @$doneList else @$activeList
     $list.append @$taskDom(task)

  # @param {function()} done called when the task is saved to the user's
  #     Dropbox
  addTask: (task, done) ->
    task.cleanupName()
    @dbClient.writeFile task.path(), '', (error, stat) =>
      return @showError(error) if error
      @addTaskToModel task

  # Called when the user wants to create a new task.
  onNewTask: (event) ->
    event.preventDefault()
    task = new Task name: $('#new-task-name').val(), done: false
    if @tasks.findByName task.name
      window.alert "You already have this task on your list!"
    else
      $('#new-task-button').attr 'disabled', 'disabled'
      $('#new-task-name').attr 'disabled', 'disabled'
      @tasks.addTask task, =>
        $('#new-task-name').removeAttr('disabled').val ''
        $('#new-task-button').removeAttr 'disabled'
