Added custom acknowledgement to ask

This commit is contained in:
saurabhbhatia 2013-08-20 11:54:20 +08:00
parent 33f256bd16
commit f333fe9e21
3 changed files with 7 additions and 17 deletions

View File

@ -14,6 +14,11 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
def create def create
@ask_question = AskQuestion.new(params[:ask_question]) @ask_question = AskQuestion.new(params[:ask_question])
if gotcha_valid? && @ask_question.save if gotcha_valid? && @ask_question.save
@acknowledgement = AskAcknowledgement.last
respond_to do |format|
format.js
# format.js { render :thank_you, notice: 'Your question has been successfully sent.' }
end
@ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new @ask_acknowledgement = AskAcknowledgement.first || AskAcknowlegement.new
#@ask_question.save #@ask_question.save
redirect_to root_path redirect_to root_path
@ -22,10 +27,6 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id) Resque.enqueue(SendAskNoticeMail, ask_admin.id, @ask_question.id)
end end
# redirect_to panel_ask_front_end_thank_you_path # redirect_to panel_ask_front_end_thank_you_path
respond_to do |format|
format.js
# format.js { render :thank_you, notice: 'Your question has been successfully sent.' }
end
end end
end end
@ -42,5 +43,5 @@ class Panel::Ask::FrontEnd::AskQuestionsController < OrbitWidgetController
@item = Page.find(params[:page_id]) rescue nil @item = Page.find(params[:page_id]) rescue nil
>>>>>>> a4fa967... Fix mailing redirect >>>>>>> a4fa967... Fix mailing redirect
end end
@acknowledgement = AskAcknowledgement.last
end end

View File

@ -1,12 +1 @@
<% #if @ask_question.errors.empty? %>
//$('html,body').scrollTop(0);
//$('#acknowledgement')
// .html('<%= j simple_format(@ask_acknowledgement.content) %>')
// .fadeIn(600)
// .delay(3000)
// .fadeOut(600);
<% #else %>
//alert('<%= @ask_question.errors.full_messages.join('\n') %>');
//Recaptcha.reload()
<% #end %>
window.location.href= "<%= panel_ask_front_end_thank_you_path %>" window.location.href= "<%= panel_ask_front_end_thank_you_path %>"

View File

@ -1 +1 @@
<h3>Thank you for your email, we will get back to you soon.</h3> <h3><%= @acknowledgement.content.html_safe%></h3>