add ban to post mode menu

This commit is contained in:
Albert Yi
2016-12-09 11:56:25 -08:00
parent dfb7a000a5
commit 2af622e7a7
6 changed files with 33 additions and 2 deletions

View File

@@ -51,7 +51,14 @@ module Moderator
if params[:commit] == "Ban"
@post.ban!
end
redirect_to(post_path(@post), :notice => "Post was banned")
respond_to do |fmt|
fmt.html do
redirect_to(post_path(@post), :notice => "Post was banned")
end
fmt.js
end
end
def unban