Good day! There is a problem with the websocket in Rails, unfortunately, I still haven't figured out how to implement the functionality using ActionCable, so I used private_pub.
Everything works, but if you follow the links and return to the page where you subscribe to the channel with the help of the subscribe_to helper, the callback is executed several times (+ for each turbolinks download).
I think that this is not the fault of the kolbek, since If you send js to the channel, the picture is the same. It seems to me that every time the page loads, the channel is subscribed to this behavior from here.
How to win, not to think ... Write in the comments, what code to publish, thank you!