Sha256: 43a734c9039ceacf36e6749d3c26015537ba8215cfeb1d20bdc44da3c2f19f95

Contents?: true

Size: 675 Bytes

Versions: 46

Compression:

Stored size: 675 Bytes

Contents

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

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

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

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

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
avo-3.10.2 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.10.1 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.10.0 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.9.2 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.9.1 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.8.2 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.9.0 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.8.1 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.8.0 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.6.4 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.6.3 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.6.2 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.6.1 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.6.0 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.5.8 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.5.7 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.5.6 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.5.6.beta1 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.5.5 app/helpers/avo/turbo_stream_actions_helper.rb
avo-3.5.4 app/helpers/avo/turbo_stream_actions_helper.rb