adds comment show view

This commit is contained in:
rgarcia
2016-01-07 14:19:05 +01:00
parent 5e9240e25c
commit 816a95b7b7
11 changed files with 69 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
class CommentsController < ApplicationController
before_action :authenticate_user!
before_action :authenticate_user!, only: :create
before_action :load_commentable, only: :create
before_action :build_comment, only: :create
@@ -14,6 +14,11 @@ class CommentsController < ApplicationController
end
end
def show
@comment = Comment.find(params[:id])
set_comment_flags(@comment.subtree)
end
def vote
@comment.vote_by(voter: current_user, vote: params[:value])
respond_with @comment