diff options
author | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-02-23 15:09:35 -0500 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-17 12:20:14 +0000 |
commit | fa570525dbe35fb598b8a269198e1173da6d7ae3 (patch) | |
tree | 13098cbb1aaad8ec4706423ec11b4514a3cbd948 /app/controllers/dashboard | |
parent | 4171933c0963696626c879c2d05afa1594a71d99 (diff) | |
download | gitlab-ce-fa570525dbe35fb598b8a269198e1173da6d7ae3.tar.gz |
Adds small AJAX optimistic functionality to todos.
Fixes #13656
A good first step and boring solution.
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r-- | app/controllers/dashboard/todos_controller.rb | 7 |
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 |