diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 0cb2a5b44..49dee85e9 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -35,13 +35,15 @@ class CommentsController < ApplicationController def flag Flag.flag(current_user, @comment) set_comment_flags(@comment) - respond_with @comment, template: "comments/_refresh_flag_actions" + + render "comments/_refresh_flag_actions" end def unflag Flag.unflag(current_user, @comment) set_comment_flags(@comment) - respond_with @comment, template: "comments/_refresh_flag_actions" + + render "comments/_refresh_flag_actions" end private diff --git a/app/controllers/concerns/flag_actions.rb b/app/controllers/concerns/flag_actions.rb index 5984c24e0..cc305dca1 100644 --- a/app/controllers/concerns/flag_actions.rb +++ b/app/controllers/concerns/flag_actions.rb @@ -4,21 +4,13 @@ module FlagActions def flag Flag.flag(current_user, flaggable) - if controller_name == "investments" - respond_with flaggable, template: "budgets/#{controller_name}/_refresh_flag_actions" - else - respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions" - end + render "_refresh_flag_actions" end def unflag Flag.unflag(current_user, flaggable) - if controller_name == "investments" - respond_with flaggable, template: "budgets/#{controller_name}/_refresh_flag_actions" - else - respond_with flaggable, template: "#{controller_name}/_refresh_flag_actions" - end + render "_refresh_flag_actions" end private