Remove unused add_question action from admin polls controller

Since commit adf18ee756  this action no longer makes sense.
This commit is contained in:
taitus
2022-09-07 14:25:15 +02:00
parent 5011d4745b
commit 38b6cf36a2
5 changed files with 1 additions and 20 deletions

View File

@@ -42,18 +42,6 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
end
end
def add_question
question = ::Poll::Question.find(params[:question_id])
if question.present?
@poll.questions << question
notice = t("admin.polls.flash.question_added")
else
notice = t("admin.polls.flash.error_on_question_added")
end
redirect_to admin_poll_path(@poll), notice: notice
end
def booth_assignments
@polls = Poll.current.created_by_admin
end

View File

@@ -83,7 +83,7 @@ module Abilities
can [:index, :create, :update, :destroy], Geozone
can [:read, :create, :update, :destroy, :add_question, :booth_assignments], Poll
can [:read, :create, :update, :destroy, :booth_assignments], Poll
can [:read, :create, :update, :destroy, :available], Poll::Booth
can [:search, :create, :index, :destroy], ::Poll::Officer
can [:create, :destroy, :manage], ::Poll::BoothAssignment

View File

@@ -1103,9 +1103,6 @@ en:
table_title: "Title"
edit_answers: Edit answers
see_proposal: "(See proposal)"
flash:
question_added: "Question added to this poll"
error_on_question_added: "Question could not be assigned to this poll"
destroy:
alert: "This action will remove the poll and all its associated questions."
success_notice: "Poll deleted successfully"

View File

@@ -1102,9 +1102,6 @@ es:
table_title: "Título"
edit_answers: Editar respuestas
see_proposal: "(Ver propuesta)"
flash:
question_added: "Pregunta añadida a esta votación"
error_on_question_added: "No se pudo asignar la pregunta"
destroy:
alert: "Esta acción eliminará la votación y todas sus preguntas asociadas."
success_notice: "Votación eliminada correctamente"

View File

@@ -141,7 +141,6 @@ namespace :admin do
scope module: :poll do
resources :polls do
get :booth_assignments, on: :collection
patch :add_question, on: :member
resources :booth_assignments, only: [:index, :show, :create, :destroy] do
get :search_booths, on: :collection