From 777237421fa5a4d777ccf17ec7add08b044d0d3e Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 7 Oct 2017 14:55:08 +0200 Subject: [PATCH] fixes specs --- app/controllers/admin/poll/questions/answers_controller.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/admin/poll/questions/answers_controller.rb b/app/controllers/admin/poll/questions/answers_controller.rb index 18b44d279..511807b10 100644 --- a/app/controllers/admin/poll/questions/answers_controller.rb +++ b/app/controllers/admin/poll/questions/answers_controller.rb @@ -1,6 +1,5 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController 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" @@ -12,7 +11,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController @answer = ::Poll::Question::Answer.new(answer_params) if @answer.save - redirect_to admin_question_path(@question), + redirect_to admin_question_path(@answer.question), notice: t("flash.actions.create.poll_question_answer") else render :new @@ -50,8 +49,4 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController @answer = ::Poll::Question::Answer.find(params[:id] || params[:answer_id]) end - def load_question - @question = @answer.question - end - end