Sha256: 94bf90a821a2e678db2589a8fdac7242b7b4c982634cefec8beff5e87908f3b3

Contents?: true

Size: 664 Bytes

Versions: 2

Compression:

Stored size: 664 Bytes

Contents

module Avo
  module TurboStreamActionsHelper
    def avo_download(content:, filename:)
      turbo_stream_action_tag :download, content: content, filename: filename
    end

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

    def avo_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
  end
end

Turbo::Streams::TagBuilder.prepend(Avo::TurboStreamActionsHelper)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
avo-3.15.1 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.15.0 app/helpers/avo/turbo_stream_actions_helper.rb