summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard/todos_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/dashboard/todos_controller.rb')
-rw-r--r--app/controllers/dashboard/todos_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb
index 43cf8fa71af..54f718d0110 100644
--- a/app/controllers/dashboard/todos_controller.rb
+++ b/app/controllers/dashboard/todos_controller.rb
@@ -8,9 +8,14 @@ class Dashboard::TodosController < Dashboard::ApplicationController
def destroy
todo.done!
+ todo_notice = 'Todo was successfully marked as done.'
+
respond_to do |format|
- format.html { redirect_to dashboard_todos_path, notice: 'Todo was successfully marked as done.' }
+ format.html { redirect_to dashboard_todos_path, notice: todo_notice }
format.js { render nothing: true }
+ format.json do
+ render json: { status: 'OK', notice: todo_notice }
+ end
end
end