Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-03-17 16:08:59 +0300
committerPhil Hughes <me@iamphill.com>2016-03-17 16:08:59 +0300
commit41c107beccda574aefd3e5d992345087b2e0d848 (patch)
tree4289913a852453a663f1a12e6c0c9e456b96b76f /app/controllers/dashboard/todos_controller.rb
parent421215e3385860af42530895c22021c0704275e2 (diff)
Mark all as done through AJAX
Diffstat (limited to 'app/controllers/dashboard/todos_controller.rb')
-rw-r--r--app/controllers/dashboard/todos_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb
index 10120dfdf3b..7857af9c5de 100644
--- a/app/controllers/dashboard/todos_controller.rb
+++ b/app/controllers/dashboard/todos_controller.rb
@@ -25,6 +25,10 @@ class Dashboard::TodosController < Dashboard::ApplicationController
respond_to do |format|
format.html { redirect_to dashboard_todos_path, notice: 'All todos were marked as done.' }
format.js { render nothing: true }
+ format.json do
+ find_todos
+ render json: { count: @todos.size, done_count: current_user.todos.done.count }
+ end
end
end