Unify with the rest of application destroy method in questions controller
We also add a missing translation.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user