Merge branch 'polls-gallery-polish' of https://github.com/consul/consul into polls-gallery-polish

This commit is contained in:
decabeza
2017-10-07 15:23:51 +02:00

View File

@@ -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