This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/vendor/built_in_modules/ask/app/controllers/panel/ask/back_end/ask_replies_controller.rb

29 lines
840 B
Ruby

class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
include AdminHelper
include OrbitControllerLib::DivisionForDisable
def initialize
super
@app_title = 'ask_replies'
end
def create
@ask_question = AskQuestion.find(params[:ask_question_id])
@ask_question.ask_reply.create(params[:ask_reply])
if @ask_question.ask_reply.send_email?
::AskMailer.reply(@ask_question).deliver
end
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
end
def update
@ask_reply = AskReply.find(params[:id])
@ask_reply.update_attributes(params[:ask_reply])
if @ask_reply.send_email?
Resque.enqueue(SendAskReplyMail, @reply.ask_question.id)
end
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
end
end