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.

Options Hash (options):

  • :id (String)

    The ID attribute for the HTML tag.



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