Add given_order to related poll question answers forms

Since given order is no longer being generated automatically we need
to add it to related forms and to strong parameters methods
This commit is contained in:
Senén Rodero Rodríguez
2018-12-27 18:13:32 +01:00
parent c73aae9663
commit 9d9ad5003b
5 changed files with 10 additions and 4 deletions

View File

@@ -50,7 +50,8 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController
def answer_params
documents_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy]
attributes = [:title, :description, :question_id, documents_attributes: documents_attributes]
attributes = [:title, :description, :given_order, :question_id,
documents_attributes: documents_attributes]
params.require(:poll_question_answer).permit(*attributes, *translation_params(Poll::Question::Answer))
end