instance method
broadcasting_for
Ruby on Rails 8.1.2
Since v6.0.6Signature
broadcasting_for(broadcastables)
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.
Parameters
-
broadcastablesreq
Source
# File actioncable/lib/action_cable/channel/broadcasting.rb, line 24
def broadcasting_for(broadcastables)
serialize_broadcasting([ channel_name ] + Array(broadcastables))
end
Defined in actioncable/lib/action_cable/channel/broadcasting.rb line 24
· View on GitHub
· Improve this page
· Find usages on GitHub