Reverse
This commit is contained in:
parent
5e05f5d02b
commit
8684388ab9
|
@ -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
|
||||
|
||||
|
|
|
@ -14,7 +14,16 @@
|
|||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#spinner").bind("ajaxSend", function() {
|
||||
$(this).show();
|
||||
}).bind("ajaxStop", function() {
|
||||
$(this).hide();
|
||||
}).bind("ajaxError", function() {
|
||||
$(this).hide();
|
||||
window.location.href = "<%= panel_ask_front_end_thank_you_path %>";
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="spinner" class="spinner" style="display:none;">
|
||||
|
@ -100,5 +109,10 @@ $(document).ready(function(){
|
|||
$('#new-ask-question .required').each(function() {
|
||||
$(this).text('*' + $(this).text());
|
||||
});
|
||||
|
||||
$('#new-ask-question form') .submit(function() {
|
||||
$.post($(this).attr('action'), $(this).serializeArray());
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue