Allow undeleting comments

This commit is contained in:
Toks
2015-07-11 13:26:55 -04:00
parent fe7f3d8204
commit a4440514ff
5 changed files with 21 additions and 2 deletions

View File

@@ -62,6 +62,15 @@ class CommentsController < ApplicationController
end
end
def undelete
@comment = Comment.find(params[:id])
check_privilege(@comment)
@comment.undelete!
respond_with(@comment) do |format|
format.js
end
end
def unvote
@comment = Comment.find(params[:id])
@comment.unvote!