Curious what the best practice is for using ActionCable with Turbolinks, when you want to tie a channel with the page being viewed.
The classic example, of course, if you had an article with comments -- how can you stream only those comments related to the article in view and then subscribe to a different channel when viewing a different article?
I've played around with using turbolinks:loaded
event on JQuery, but cant figure out what to link that to. Do I want to resubcribe every time? How is that possible without reloading the JS?
Another approach would be to
On our blog you will find a more detailed post on how to enable action cable on specific pages.
I managed that by doing something like this:
(Live streaming task output)