Documents upload for questions working

This commit is contained in:
María Checa
2017-09-06 12:00:46 +02:00
parent 39a2d25921
commit 4af44a45a1
4 changed files with 24 additions and 1 deletions

View File

@@ -10,6 +10,8 @@ class Polls::QuestionsController < ApplicationController
@comment_tree = CommentTree.new(@commentable, params[:page], @current_order)
set_comment_flags(@comment_tree.comments)
@document = Document.new(documentable: @question)
question_answer = @question.answers.where(author_id: current_user.try(:id)).first
@answers_by_question_id = {@question.id => question_answer.try(:answer)}
end