From 8684388ab9d22de9cbe190aa33d65a5eaf1e8224 Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Fri, 4 Oct 2013 17:47:26 +0800 Subject: [PATCH] Reverse --- .../ask/front_end/ask_questions_controller.rb | 10 ++++++++-- .../ask/front_end/ask_questions/index.html.erb | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/front_end/ask_questions_controller.rb b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/front_end/ask_questions_controller.rb index 0f5191a69..e94ffe0bf 100644 --- a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/front_end/ask_questions_controller.rb +++ b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/front_end/ask_questions_controller.rb @@ -22,9 +22,15 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id) end - redirect_to panel_ask_front_end_thank_you_path + # Render to create.js.erb + respond_to do |format| + format.js + end else - redirect_to panel_ask_front_end_sorry_path + # Render to index.js.erb + respond_to do |format| + format.js { render :index } + end end end diff --git a/vendor/built_in_modules/ask_new/app/views/panel/ask/front_end/ask_questions/index.html.erb b/vendor/built_in_modules/ask_new/app/views/panel/ask/front_end/ask_questions/index.html.erb index fdf8faf48..72ac88d59 100644 --- a/vendor/built_in_modules/ask_new/app/views/panel/ask/front_end/ask_questions/index.html.erb +++ b/vendor/built_in_modules/ask_new/app/views/panel/ask/front_end/ask_questions/index.html.erb @@ -14,7 +14,16 @@ }