instance method
broadcast_prepend_to
Ruby on Rails 1.3.3
Since v1.3.3 Last seen in v2.0.23Signature
broadcast_prepend_to(*streamables, target: broadcast_target_default, **rendering)
Prepend a rendering of this broadcastable model to the target identified by it’s dom id passed as target for subscribers of the stream name identified by the passed streamables. The rendering parameters can be set by appending named arguments to the call. 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_prepend_to examiner.identity, :clearances, target: "clearances" # Sends <turbo-stream action="prepend" target="clearances"><template><div id="clearance_5">Other partial</div></template></turbo-stream> # to the stream named "identity:2:clearances" clearance.broadcast_prepend_to examiner.identity, :clearances, target: "clearances", partial: "clearances/other_partial", locals: { a: 1 }
Parameters
-
streamablesrest -
targetkey = broadcast_target_default -
renderingkeyrest
Source
# File app/models/concerns/turbo/broadcastable.rb, line 211
def broadcast_prepend_to(*streamables, target: broadcast_target_default, **rendering)
Turbo::StreamsChannel.broadcast_prepend_to(*streamables, target: target, **broadcast_rendering_with_defaults(rendering))
end
Defined in app/models/concerns/turbo/broadcastable.rb line 211
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Turbo::Broadcastable