Module: ActionDispatch::Flash::RequestMethods
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | actionpack/lib/action_dispatch/middleware/flash.rb |
Instance Attribute Summary
-
#flash
rw
Access the contents of the flash.
- #flash=(flash) rw
Instance Method Summary
- #commit_flash Internal use only
- #flash_hash Internal use only
- #reset_session Internal use only
Instance Attribute Details
#flash (rw)
Access the contents of the flash. Returns a FlashHash
.
See ::ActionDispatch::Flash
for example usage.
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 57
def flash flash = flash_hash return flash if flash self.flash = Flash::FlashHash.from_session_value(session["flash"]) end
#flash=(flash) (rw)
[ GitHub ]Instance Method Details
#commit_flash
This method is for internal use only.
[ GitHub ]
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 71
def commit_flash # :nodoc: return unless session.enabled? if flash_hash && (flash_hash.present? || session.key?("flash")) session["flash"] = flash_hash.to_session_value self.flash = flash_hash.dup end if session.loaded? && session.key?("flash") && session["flash"].nil? session.delete("flash") end end
#flash_hash
This method is for internal use only.
[ GitHub ]
#reset_session
This method is for internal use only.
[ GitHub ]
# File 'actionpack/lib/action_dispatch/middleware/flash.rb', line 84
def reset_session # :nodoc: super self.flash = nil end