Skip to content

Commit 67630e4

Browse files
author
Vidas P
committed
Fix 'delete messages' action
1 parent 3afedc1 commit 67630e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/controllers/agents_controller.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ def remove_messages
123123
@agent.messages.delete_all
124124

125125
respond_to do |format|
126-
format.json do
127-
head :no_content
126+
format.html do
127+
redirect_back(fallback_location: agent_path(@agent),
128+
notice: "Messages deleted for '#{@agent.name}'")
128129
end
130+
format.json { head :ok }
129131
end
130132
end
131133

0 commit comments

Comments
 (0)