removes @question on questions answers
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
|
class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
|
||||||
before_action :load_question
|
|
||||||
before_action :load_answer, only: [:update, :documents]
|
before_action :load_answer, only: [:update, :documents]
|
||||||
|
|
||||||
load_and_authorize_resource :question, class: "::Poll::Question"
|
load_and_authorize_resource :question, class: "::Poll::Question"
|
||||||
@@ -43,7 +42,4 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
|
|||||||
@answer = ::Poll::Question::Answer.find(params[:id] || params[:answer_id])
|
@answer = ::Poll::Question::Answer.find(params[:id] || params[:answer_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_question
|
|
||||||
@question = ::Poll::Question.find(params[:question_id])
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,18 +3,17 @@
|
|||||||
<h2><%= t("admin.questions.show.answers.documents_list") %></h2>
|
<h2><%= t("admin.questions.show.answers.documents_list") %></h2>
|
||||||
|
|
||||||
<ul class="breadcrumbs">
|
<ul class="breadcrumbs">
|
||||||
<li><%= link_to @question.poll.name, admin_poll_path(@question.poll) %></li>
|
<li><%= @answer.question.title %></li>
|
||||||
<li><%= link_to @question.title, admin_question_path(@question) %></li>
|
|
||||||
<li><%= @answer.title %></li>
|
<li><%= @answer.title %></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="poll-question-answer-form">
|
<div class="poll-question-form">
|
||||||
<%= form_for(@answer, url: admin_question_answer_path(@question, @answer)) do |f| %>
|
<%= form_for(Poll::Question::Answer.new,
|
||||||
|
url: admin_answer_documents_path(@answer),
|
||||||
|
method: :post) do |f| %>
|
||||||
|
|
||||||
<%= render 'shared/errors', resource: @answer %>
|
<%= render 'shared/errors', resource: @answer %>
|
||||||
|
|
||||||
<%= f.hidden_field :question_id, value: @question.id %>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<div class="documents small-12">
|
<div class="documents small-12">
|
||||||
|
|||||||
Reference in New Issue
Block a user