Method: Turbo::Streams::TagBuilder#replace_all
- Defined in:
- app/models/turbo/streams/tag_builder.rb
#replace_all(targets, content = nil, method: nil, **rendering, &block) ⇒ Object
Replace the targets in the dom with either 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. Examples:
<%= turbo_stream.replace_all ".clearance_item", "<div class='clearance_item'>Replace the dom target identified by the class clearance_item</div>" %>
<%= turbo_stream.replace_all clearance %>
<%= turbo_stream.replace_all clearance, partial: "clearances/clearance", locals: { title: "Hello" } %>
<%= turbo_stream.replace_all ".clearance_item" do %>
<div class='.clearance_item'>Replace the dom target identified by the class clearance_item</div>
<% end %>
<%= turbo_stream.replace_all clearance, "<div>Morph the dom target</div>", method: :morph %>
95 96 97 |
# File 'app/models/turbo/streams/tag_builder.rb', line 95 def replace_all(targets, content = nil, method: nil, **rendering, &block) action_all :replace, targets, content, method: method, **rendering, &block end |