Module: TurboFlash::FlashHash

Defined in:
lib/turbo_flash/flash_hash.rb

Instance Method Summary collapse

Instance Method Details

#turboObject

create a Flash::Turbo instance.

Behaves just like ‘flash.now`, but gets injected into your TurboStream response.

flash.turbo[:notice] = "There was an error"


12
13
14
# File 'lib/turbo_flash/flash_hash.rb', line 12

def turbo
  @turbo ||= ::TurboFlash::FlashTurbo.new(self)
end

#turbo!(options = {}) ⇒ Object

Copy over flashes



17
18
19
20
21
# File 'lib/turbo_flash/flash_hash.rb', line 17

def turbo!(options = {})
  turbo.from_flashes(@flashes, options)

  true
end