Subscribe to an ActionCable Channel specific to a particular view

How would you only subscribe to an ActionCable channel on the client
depending on which view you are in lets say you have a products
controller
and a inventory controller and you wanted to subscribe to the products
channel only when you are on the products view and the inventory channel
only when you are on the inventory view?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs