Fixed answer documents form

This commit is contained in:
María Checa
2017-10-06 12:02:24 +02:00
parent a15d1a4020
commit c5c1ea7251
2 changed files with 3 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
def update
if @answer.update(answer_params)
redirect_to admin_question_path(@question), notice: t("flash.actions.save_changes.notice")
redirect_to admin_question_path(@answer.question), notice: t("flash.actions.save_changes.notice")
else
redirect_to :back
end

View File

@@ -9,8 +9,8 @@
<div class="poll-question-form">
<%= form_for(Poll::Question::Answer.new,
url: admin_answer_documents_path(@answer),
method: :post) do |f| %>
url: admin_answer_path(@answer),
method: :put) do |f| %>
<%= render 'shared/errors', resource: @answer %>