method
broadcasting_for
v8.1.1 -
Show latest stable
- Class:
ActionCable::Channel::Broadcasting::ClassMethods
broadcasting_for(broadcastables)public
Returns a unique broadcasting identifier for this `model` in this channel:
CommentsChannel.broadcasting_for("all") # => "comments:all"
You can pass an array of objects as a target (e.g. Active Record model), and it would be serialized into a string under the hood.