Method: Turbo::Streams::TagBuilder#before_all
- Defined in:
- app/models/turbo/streams/tag_builder.rb
#before_all(targets, content = nil, **rendering, &block) ⇒ Object
Insert the content passed in, a rendering result determined by the rendering keyword arguments, the content in the block, or the rendering of the target as a record before the targets in the dom. Examples:
<%= turbo_stream.before_all ".clearance_item", "<div class='clearance_item'>Insert before the dom target identified by the class clearance_item</div>" %>
<%= turbo_stream.before_all clearance %>
<%= turbo_stream.before_all clearance, partial: "clearances/clearance", locals: { title: "Hello" } %>
<%= turbo_stream.before_all ".clearance_item" do %>
<div class='clearance_item'>Insert before the dom target identified by clearance_item</div>
<% end %>
121 122 123 |
# File 'app/models/turbo/streams/tag_builder.rb', line 121 def before_all(targets, content = nil, **rendering, &block) action_all :before, targets, content, **rendering, &block end |