It was confusing to have the action to create an answer in `QuestionsController#answer` while the action to destroy it was `AnswersController#destroy`.
15 lines
377 B
Ruby
15 lines
377 B
Ruby
resources :polls, only: [:show, :index] do
|
|
member do
|
|
get :stats
|
|
get :results
|
|
end
|
|
|
|
resources :questions, controller: "polls/questions", shallow: true, only: [] do
|
|
resources :answers, controller: "polls/answers", only: [:create, :destroy], shallow: false
|
|
end
|
|
end
|
|
|
|
resolve "Poll::Question" do |question, options|
|
|
[:question, options.merge(id: question)]
|
|
end
|