Allow to delete answers if the poll has not started yet
Deleting answers was not even possible. But it was possible to delete questions. So we implemented the same behavior.
This commit is contained in:
committed by
Javi Martín
parent
3a6e99cb8c
commit
14542df0de
@@ -30,6 +30,11 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@answer.destroy!
|
||||
redirect_to admin_question_path(@question), notice: t("admin.answers.destroy.success_notice")
|
||||
end
|
||||
|
||||
def order_answers
|
||||
::Poll::Question::Answer.order_answers(params[:ordered_list])
|
||||
head :ok
|
||||
|
||||
Reference in New Issue
Block a user