Removed poll question show

This commit is contained in:
María Checa
2017-10-03 19:11:39 +02:00
parent 21e14776fc
commit 5bb831e959
9 changed files with 2 additions and 192 deletions

View File

@@ -5,15 +5,6 @@ class Polls::QuestionsController < ApplicationController
has_orders %w{most_voted newest oldest}, only: :show
def show
@commentable = @question.proposal.present? ? @question.proposal : @question
@comment_tree = CommentTree.new(@commentable, params[:page], @current_order)
set_comment_flags(@comment_tree.comments)
question_answer = @question.answers.where(author_id: current_user.try(:id)).first
@answers_by_question_id = {@question.id => question_answer.try(:answer)}
end
def answer
answer = @question.answers.find_or_initialize_by(author: current_user)