instance method broadcast_action_to

Ruby on Rails 1.3.3

Since v1.3.3 Last seen in v2.0.23

Available in: v1.3.3 v1.4.0 v1.5.0 v2.0.23

Signature

broadcast_action_to(*streamables, action:, target: broadcast_target_default, **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

streamables rest
action keyreq
target key = broadcast_target_default
rendering keyrest
Source
# File app/models/concerns/turbo/broadcastable.rb, line 225
  def broadcast_action_to(*streamables, action:, target: broadcast_target_default, **rendering)
    Turbo::StreamsChannel.broadcast_action_to(*streamables, action: action, target: target, **broadcast_rendering_with_defaults(rendering))
  end

Defined in app/models/concerns/turbo/broadcastable.rb line 225 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Turbo::Broadcastable

Type at least 2 characters to search.

↑↓ navigate · open · esc close