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:
Javi Martín
2020-07-07 22:22:22 +02:00
parent 4f30720593
commit a5f1245b7e
8 changed files with 7 additions and 9 deletions

View File

@@ -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