The routes for poll questions were accidentally deleted in commit5bb831e959when deleting the `:show` action, and restored in commit9871503c5e. However, the deleted code was: ``` resources :questions, only: [:show], controller: 'polls/questions' (...) ``` While the restored code was: ``` resources :questions, controller: 'polls/questions' (...) ``` Meaning we forgot to add the `only: []` option when restoring the routes. We also forgot to remove the `before_action` code when deleting the `:show` action, so we're removing it now.
16 lines
396 B
Ruby
16 lines
396 B
Ruby
resources :polls, only: [:show, :index] do
|
|
member do
|
|
get :stats
|
|
get :results
|
|
end
|
|
|
|
resources :questions, controller: "polls/questions", shallow: true, only: [] do
|
|
post :answer, on: :member
|
|
resources :answers, controller: "polls/answers", only: :destroy, shallow: false
|
|
end
|
|
end
|
|
|
|
resolve "Poll::Question" do |question, options|
|
|
[:question, options.merge(id: question)]
|
|
end
|