Method: Turbo::Streams::TagBuilder#prepend

Defined in:
app/models/turbo/streams/tag_builder.rb

#prepend(target, content = nil, **rendering, &block) ⇒ Object

Prepend to the target in the dom identified with target either the content passed in or a rendering result determined by the rendering keyword arguments or the content in the block, or the rendering of the content as a record. Examples:

<%= turbo_stream.prepend "clearances", "<div id='clearance_5'>Prepend this to .clearances</div>" %>
<%= turbo_stream.prepend "clearances", clearance %>
<%= turbo_stream.prepend "clearances", partial: "clearances/unique_clearance", locals: { clearance: clearance } %>
<%= turbo_stream.prepend "clearances" do %>
  <div id='clearance_5'>Prepend this to .clearances</div>
<% end %>


217
218
219
# File 'app/models/turbo/streams/tag_builder.rb', line 217

def prepend(target, content = nil, **rendering, &block)
  action :prepend, target, content, **rendering, &block
end