Module: RailsTurboFlash::ViewHelpers

Defined in:
lib/rails_turbo_flash/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#turbo_flash_tag(options = nil) ⇒ String

Generates the HTML tag for displaying flash messages using Turbo Streams in Ruby on Rails.

Parameters:

  • options (Hash) (defaults to: nil)

    The options for customizing the HTML tag.

Options Hash (options):

  • :id (String)

    The ID attribute for the HTML tag.

Returns:

  • (String)

    The HTML tag for displaying flash messages.



11
12
13
14
15
16
# File 'lib/rails_turbo_flash/view_helpers.rb', line 11

def turbo_flash_tag(options = nil)
  options ||= {}
  options[:id] = RailsTurboFlash.config.target

  tag.div nil, **options
end