From 38f100d183883cccf9aa44d7c32ac9d69f486467 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 7 Oct 2017 14:40:26 +0200 Subject: [PATCH] fixes loading of poll question --- app/controllers/admin/poll/questions/answers_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/poll/questions/answers_controller.rb b/app/controllers/admin/poll/questions/answers_controller.rb index 45f0abcd7..18b44d279 100644 --- a/app/controllers/admin/poll/questions/answers_controller.rb +++ b/app/controllers/admin/poll/questions/answers_controller.rb @@ -1,6 +1,6 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController - before_action :load_question, except: [:show, :edit, :update] before_action :load_answer, only: [:show, :edit, :update, :documents] + before_action :load_question, except: [:show, :edit, :update] load_and_authorize_resource :question, class: "::Poll::Question" @@ -51,7 +51,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController end def load_question - @question = ::Poll::Question.find(params[:question_id]) + @question = @answer.question end end