Merge pull request #39 from medialab-prado/28-question-page-comments

Comments in legislation question page
This commit is contained in:
Fernando Blat
2016-12-23 18:20:27 +01:00
committed by GitHub
19 changed files with 583 additions and 16 deletions

View File

@@ -7,6 +7,7 @@ class Admin::Legislation::QuestionsController < Admin::Legislation::BaseControll
end
def create
@question.author = current_user
if @question.save
redirect_to admin_legislation_process_questions_path
else

View File

@@ -2,6 +2,11 @@ class Legislation::QuestionsController < Legislation::BaseController
load_and_authorize_resource :process
load_and_authorize_resource :question, through: :process
has_orders %w{most_voted newest oldest}, only: :show
def show
@commentable = @question
@comment_tree = CommentTree.new(@commentable, params[:page], @current_order)
set_comment_flags(@comment_tree.comments)
end
end