Method: Turbo::Streams::TagBuilder#before
- Defined in:
- app/models/turbo/streams/tag_builder.rb
permalink #before(target, 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 target
in the dom. Examples:
<%= turbo_stream.before "clearance_5", "<div id='clearance_4'>Insert before the dom target identified by clearance_5</div>" %>
<%= turbo_stream.before clearance %>
<%= turbo_stream.before clearance, partial: "clearances/clearance", locals: { title: "Hello" } %>
<%= turbo_stream.before "clearance_5" do %>
<div id='clearance_4'>Insert before the dom target identified by clearance_5</div>
<% end %>
108 109 110 |
# File 'app/models/turbo/streams/tag_builder.rb', line 108 def before(target, content = nil, **rendering, &block) action :before, target, content, **rendering, &block end |