app/models/turbo/streams/tag_builder.rb
# Send an action of the type <tt>name</tt>. Options described in the concrete methods.
Send an action of the type name. Options described in the concrete methods.
Send an action of the type name . Options described in the concrete methods .
def action(name, target, content = nil, allow_inferred_rendering: true, **rendering, &block)
    target_name = extract_target_name_from(target)
    case
    when content
      turbo_stream_action_tag name, target: target_name, template: (render_record(content) if allow_inferred_rendering) || content
    when block_given?
      turbo_stream_action_tag name, target: target_name, template: @view_context.capture(&block)
    when rendering.any?
      turbo_stream_action_tag name, target: target_name, template: @view_context.render(formats: [ :html ], **rendering)
    else
      turbo_stream_action_tag name, target: target_name, template: (render_record(target) if allow_inferred_rendering)
    end
  end
def action ( name , target , content = nil , allow_inferred_rendering : true , ** rendering , & block ) target_name = extract_target_name_from ( target ) case when content turbo_stream_action_tag name , target : target_name , template : ( render_record ( content ) if allow_inferred_rendering ) || content when block_given? turbo_stream_action_tag name , target : target_name , template : @view_context . capture ( & block ) when rendering . any? turbo_stream_action_tag name , target : target_name , template : @view_context . render ( formats : [ :html ] , ** rendering ) else turbo_stream_action_tag name , target : target_name , template : ( render_record ( target ) if allow_inferred_rendering ) end end
Send an action of the type <tt>name</tt>.
Send an action of the type <tt > name< / tt > .
name
<not_specific>
target
<not_specific>
content
<not_specific>
allow_inferred_rendering
<not_specific>
rendering
<not_specific>
block
<not_specific>