From 2a83c6b51d5f723318f4e4e6426206a48145ae08 Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Tue, 10 Dec 2013 18:42:28 +0800 Subject: [PATCH] Desktop sync button.. not finished --- app/controllers/admin/import_data_controller.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index ae33d4da..711cf40e 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -332,6 +332,7 @@ def sync_conference_data def sync_journal_paper_data + @journal_data = WritingJournal.where(create_user_id: "#{params[:user_id]}") @journal_data.delete_all @user = User.find("#{params[:user_id]}") @@ -400,7 +401,13 @@ def sync_conference_data end end - redirect_to request.referer + + respond_to do |format| + + format.html { redirect_to request.referer } + format.json { render json: {"success"=>true}.to_json} + + end end def sync_book_data @@ -444,7 +451,13 @@ def sync_book_data end end end - redirect_to request.referer + + respond_to do |format| + + format.html { redirect_to request.referer } + format.json { render json: {"success"=>true}.to_json} + + end end