Fix #4770: Allow flaggers to update flag reason.

This commit is contained in:
evazion
2021-03-23 01:25:43 -05:00
parent 41e0cad458
commit 6a84d33409
6 changed files with 98 additions and 2 deletions

View File

@@ -31,4 +31,17 @@ class PostFlagsController < ApplicationController
fmt.html { redirect_to post_flags_path(search: { id: @post_flag.id }) }
end
end
def edit
@post_flag = authorize PostFlag.find(params[:id])
respond_with(@post_flag)
end
def update
@post_flag = authorize PostFlag.find(params[:id])
@post_flag.update(permitted_attributes(@post_flag))
respond_with(@post_flag) do |fmt|
fmt.html { redirect_to post_path(@post_flag.post) }
end
end
end