Extract partial to refresh flag actions
Now that we're rendering `shared/flag_actions` everywhere, we can use the same code in all cases.
This commit is contained in:
@@ -36,14 +36,14 @@ class CommentsController < ApplicationController
|
||||
Flag.flag(current_user, @comment)
|
||||
set_comment_flags(@comment)
|
||||
|
||||
render "comments/_refresh_flag_actions"
|
||||
render "shared/_refresh_flag_actions", locals: { flaggable: @comment, divider: true }
|
||||
end
|
||||
|
||||
def unflag
|
||||
Flag.unflag(current_user, @comment)
|
||||
set_comment_flags(@comment)
|
||||
|
||||
render "comments/_refresh_flag_actions"
|
||||
render "shared/_refresh_flag_actions", locals: { flaggable: @comment, divider: true }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user