instance method prepend

Ruby on Rails 1.4.0

Since v1.3.3 Last seen in v2.0.23

Available in: v1.3.3 v1.4.0 v1.5.0 v2.0.23

Signature

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

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 %>

Parameters

target req
content opt = nil
rendering keyrest
block block
Source
# File app/models/turbo/streams/tag_builder.rb, line 195
  def prepend(target, content = nil, **rendering, &block)
    action :prepend, target, content, **rendering, &block
  end

Defined in app/models/turbo/streams/tag_builder.rb line 195 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Turbo::Streams::TagBuilder

Type at least 2 characters to search.

↑↓ navigate · open · esc close