diff --git a/app/controllers/polls/questions_controller.rb b/app/controllers/polls/questions_controller.rb index 0e7f9a1c9..3db380663 100644 --- a/app/controllers/polls/questions_controller.rb +++ b/app/controllers/polls/questions_controller.rb @@ -2,8 +2,6 @@ class Polls::QuestionsController < ApplicationController load_and_authorize_resource :poll load_and_authorize_resource :question, class: "Poll::Question" - has_orders %w[most_voted newest oldest], only: :show - def answer answer = @question.find_or_initialize_user_answer(current_user, params[:answer]) answer.save_and_record_voter_participation diff --git a/config/routes/poll.rb b/config/routes/poll.rb index 94cf504b4..d33e75923 100644 --- a/config/routes/poll.rb +++ b/config/routes/poll.rb @@ -4,7 +4,7 @@ resources :polls, only: [:show, :index] do get :results end - resources :questions, controller: "polls/questions", shallow: true do + resources :questions, controller: "polls/questions", shallow: true, only: [] do post :answer, on: :member resources :answers, controller: "polls/answers", only: :destroy, shallow: false end diff --git a/spec/routing/polymorphic_routes_spec.rb b/spec/routing/polymorphic_routes_spec.rb index c39b986d5..cf2e748dd 100644 --- a/spec/routing/polymorphic_routes_spec.rb +++ b/spec/routing/polymorphic_routes_spec.rb @@ -53,12 +53,6 @@ describe "Polymorphic routes" do ) end - it "routes poll questions" do - question = create(:poll_question) - - expect(polymorphic_path(question)).to eq question_path(question) - end - it "routes topics" do community = create(:proposal).community topic = create(:topic, community: community)