How to disconnect a client in Action cable (rails 5)? I would like the user to be completely disconnected (similar to when he closes the tab).
My work around was to create a new route just for disconnect.
def disconnection
ActionCable.server.remote_connections.where(connected_user: user_params['email']).disconnect
render json: {}, status: 200
end
The client side would have to call the endpoint... something like
PUT /api/cable/disconnection