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
|
||||
|
||||
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
|
||||
|
||||
@@ -1126,6 +1126,8 @@ en:
|
||||
new:
|
||||
title: "Create question to poll %{poll}"
|
||||
title_proposal: "Create question"
|
||||
destroy:
|
||||
notice: "Question deleted succesfully"
|
||||
answers:
|
||||
images:
|
||||
add_image: "Add image"
|
||||
|
||||
@@ -1125,6 +1125,8 @@ es:
|
||||
new:
|
||||
title: "Crear pregunta ciudadana para la votación %{poll}"
|
||||
title_proposal: "Crear pregunta ciudadana"
|
||||
destroy:
|
||||
notice: "Pregunta eliminada correctamente"
|
||||
answers:
|
||||
images:
|
||||
add_image: "Añadir imagen"
|
||||
|
||||
Reference in New Issue
Block a user