diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 338f72cc4..834c9950d 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -27,4 +27,8 @@ class PollsController < ApplicationController @comment_tree = CommentTree.new(@commentable, params[:page], @current_order) end + def results + @poll = Poll.find(params[:poll_id]) + end + end diff --git a/config/routes.rb b/config/routes.rb index 1fb74aa53..3a7c1dcae 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -113,6 +113,7 @@ Rails.application.routes.draw do end resources :polls, only: [:show, :index] do + get :results resources :questions, controller: 'polls/questions', shallow: true do post :answer, on: :member end