Unify with the rest of application destroy method in questions controller

We also add a missing translation.
This commit is contained in:
taitus
2022-09-09 11:52:50 +02:00
parent ad9362399e
commit 8b4cd13675
3 changed files with 6 additions and 6 deletions

View File

@@ -43,12 +43,8 @@ class Admin::Poll::QuestionsController < Admin::Poll::BaseController
end
def destroy
if @question.destroy
notice = "Question destroyed succesfully"
else
notice = t("flash.actions.destroy.error")
end
redirect_to admin_poll_path(@question.poll), notice: notice
@question.destroy!
redirect_to admin_poll_path(@question.poll), notice: t("admin.questions.destroy.notice")
end
private