Module: Avo::TurboStreamActionsHelper

Defined in:
app/helpers/avo/turbo_stream_actions_helper.rb

Instance Method Summary collapse

Instance Method Details

#close_modalObject



13
14
15
16
17
# File 'app/helpers/avo/turbo_stream_actions_helper.rb', line 13

def close_modal
  turbo_stream_action_tag :replace,
    target: Avo::MODAL_FRAME_ID,
    template: @view_context.turbo_frame_tag(Avo::MODAL_FRAME_ID, data: {turbo_temporary: 1})
end

#download(content:, filename:) ⇒ Object



3
4
5
# File 'app/helpers/avo/turbo_stream_actions_helper.rb', line 3

def download(content:, filename:)
  turbo_stream_action_tag :download, content: content, filename: filename
end

#flash_alertsObject



7
8
9
10
11
# File 'app/helpers/avo/turbo_stream_actions_helper.rb', line 7

def flash_alerts
  turbo_stream_action_tag :append,
    target: "alerts",
    template: @view_context.render(Avo::FlashAlertsComponent.new(flashes: @view_context.flash.discard))
end