ActionCable channel that streams Turbo updates safely

6388
0

Even with model broadcasts, it’s useful to know how streams map to ActionCable channels. Turbo::StreamsChannel is essentially a channel that streams from a signed stream name. When I need custom behavior, I still follow the same scoping rules: identify the current user/account and stream from a deterministic name. The stream name should reflect authorization boundaries. In apps with multiple real-time features, I keep stream names consistent and predictable (arrays like [account, :events]). This makes it easier to reason about who can receive what. If you ever need to debug, you can log the stream name or inspect the websocket frames. But ideally you rarely touch channels directly; you broadcast HTML and Turbo does the rest.