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
|
||||
|
||||
Reference in New Issue
Block a user