[]
characters that suffix the cable_ready
method.clear: false
as the last parameter to broadcast
:console_log
and dispatch_event
- instead of just console_log
.broadcast
call:stream_from
is [just] a string, which means that we can construct all manner of dynamic identifiers based on information available to us from the Channel and Connection, as well as a params
hash that comes from the client when the Channel subscription is received.params
you get from an ActionCable Channel subscription request is conceptually similar to what you get from a typical ActionDispatch controller request. They do not go through the Rails router, however, and they are only for Channel subscriptions.ApplicationCable
definition, which supports Devise authentication but falls back on request.session.id
so that nobody is turned away:stream_from
string.:current_user
and :session_id
) which refer to the objects defined in connection.rb
using identified_by
directives AND Channel stream identifiers, which are the mailboxes/routing channels we broadcast to with CableReady (e.g. "sailors"). 🤦♀️session_id
and current_user
:current_user
in scope:meta
tag with the name nickname
. Anonymous visitors to the site have not yet had an opportunity to be given a salty sailor nickname.meta
tag in the head
, then passed to the Channel subscription as a 2nd parameter.channel
and the value will be the name of the channel. An arbitrary number of additional key/value pairs can also be passed, and that's how we tell the server about our nickname (which will be blank if it hasn't been set).params
hash: