Module: TurboFlash::FlashHash
- Defined in:
- lib/turbo_flash/flash_hash.rb
Instance Method Summary collapse
-
#turbo ⇒ Object
create a Flash::Turbo instance.
-
#turbo!(options = {}) ⇒ Object
Copy over flashes.
Instance Method Details
#turbo ⇒ Object
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!( = {}) turbo.from_flashes(@flashes, ) true end |