rails / 7.1 / actiondispatch / flash / requestmethods.html

module ActionDispatch::Flash::RequestMethods

Public Instance Methods

flash() Show source
# File actionpack/lib/action_dispatch/middleware/flash.rb, line 50
def flash
  flash = flash_hash
  return flash if flash
  self.flash = Flash::FlashHash.from_session_value(session["flash"])
end

Access the contents of the flash. Returns a ActionDispatch::Flash::FlashHash.

See ActionDispatch::Flash for example usage.

flash=(flash) Show source
# File actionpack/lib/action_dispatch/middleware/flash.rb, line 56
def flash=(flash)
  set_header Flash::KEY, flash
end

© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.