streams in the channel do not switch when navigating through pages ... what is the point - when connected to the response channel, a stream is connected with question_id
#answers.coffee $ -> App.answers_subscribe = App.cable.subscriptions.create 'AnswersChannel', connected: -> console.log 'Подключено к AnswersChannel' question_id = $('.question').data('id') if question_id @perform 'follow', id: question_id console.log 'follow' else @perform 'unfollow' #answers_channel.rb class AnswersChannel < ApplicationCable::Channel def follow(data) stop_all_streams stream_from "answer_#{data['id']}" end def unfollow stop_all_streams end end when switching between pages, unfollow does not occur, flow does not change. only with forced F5. that is, if the user has updated the page to questions # index, he will not receive any messages from the show after the cable ... or, if updated in any specific questions # show, he connected to the stream answers _ # {question_id} and all, reconnection does not occur. I hung up creating a subscription to turbolinks: load, there are no results. did App.cable.subscriptions.remove after each page load, after it launched create - works. through time, really. but, it turns out that I jump the entire channel every time, and not a subscription to the stream inside the channel.
From the model I successfully broadcast to the stream, each time to the current one. but I cannot switch to this stream ...
I read the resources, watched the video, thought a lot - zero sense. who faced - tell me what is wrong ...