Sha256: 24e9f20a31bdc1080ad902a4e2bcf645775e85b65d19c3ba469d1906f01577a8

Contents?: true

Size: 671 Bytes

Versions: 3

Compression:

Stored size: 671 Bytes

Contents

module Trestle
  module Turbo
    class TagBuilder < ::Turbo::Streams::TagBuilder
      def modal(template=nil)
        turbo_stream_action_tag :modal, template: @view_context.render(template: template || @view_context.action_name, layout: "layouts/trestle/modal", prefixes: @view_context.controller._prefixes, formats: :html)
      end

      def close_modal(target)
        turbo_stream_action_tag :closeModal, targets: target
      end

      def flash
        turbo_stream_action_tag :flash, template: @view_context.render(partial: "trestle/flash/flash", formats: :html)
      end

      def reload
        turbo_stream_action_tag :reload
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trestle-0.10.1 app/helpers/trestle/turbo/tag_builder.rb
trestle-0.10.0 app/helpers/trestle/turbo/tag_builder.rb
trestle-0.10.0.pre2 app/helpers/trestle/turbo/tag_builder.rb