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 end
def destroy def destroy
if @question.destroy @question.destroy!
notice = "Question destroyed succesfully" redirect_to admin_poll_path(@question.poll), notice: t("admin.questions.destroy.notice")
else
notice = t("flash.actions.destroy.error")
end
redirect_to admin_poll_path(@question.poll), notice: notice
end end
private private

View File

@@ -1126,6 +1126,8 @@ en:
new: new:
title: "Create question to poll %{poll}" title: "Create question to poll %{poll}"
title_proposal: "Create question" title_proposal: "Create question"
destroy:
notice: "Question deleted succesfully"
answers: answers:
images: images:
add_image: "Add image" add_image: "Add image"

View File

@@ -1125,6 +1125,8 @@ es:
new: new:
title: "Crear pregunta ciudadana para la votación %{poll}" title: "Crear pregunta ciudadana para la votación %{poll}"
title_proposal: "Crear pregunta ciudadana" title_proposal: "Crear pregunta ciudadana"
destroy:
notice: "Pregunta eliminada correctamente"
answers: answers:
images: images:
add_image: "Añadir imagen" add_image: "Añadir imagen"