Merge branch 'master' into notifications

This commit is contained in:
Juanjo Bazán
2016-01-08 15:07:16 +01:00
13 changed files with 100 additions and 32 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
@@ -15,6 +15,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