instance method
broadcast_action_to
Ruby on Rails 2.0.23
Since v1.3.3 Last seen in v2.0.23Signature
broadcast_action_to(*streamables, action:, target: broadcast_target_default, attributes: {}, **rendering)
Broadcast a named action, allowing for dynamic dispatch, instead of using the concrete action methods. Examples:
# Sends <turbo-stream action="prepend" target="clearances"><template><div id="clearance_5">My Clearance</div></template></turbo-stream> # to the stream named "identity:2:clearances" clearance.broadcast_action_to examiner.identity, :clearances, action: :prepend, target: "clearances"
Parameters
-
streamablesrest -
actionkeyreq -
targetkey = broadcast_target_default -
attributeskey = {} -
renderingkeyrest
Source
# File app/models/concerns/turbo/broadcastable.rb, line 395
def broadcast_action_to(*streamables, action:, target: broadcast_target_default, attributes: {}, **rendering)
Turbo::StreamsChannel.broadcast_action_to(*streamables, action: action, attributes: attributes, **extract_options_and_add_target(rendering, target: target)) unless suppressed_turbo_broadcasts?
end
Defined in app/models/concerns/turbo/broadcastable.rb line 395
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Turbo::Broadcastable