Marten::Middleware::Flash
Inherits Marten::Middleware / Reference / Object
Enables the use of flash messages.
When this middleware is used, each request will have a flash store initialized and populated from the request's session store. This flash store is a hash-like object that allows to fetch or set values that are associated with specific keys, and that will only be available to the next request (after that they are cleared out).
The flash store depends on the presence of a working session store. As such, the Marten::Middleware::Session
middleware MUST be used along with this middleware. Moreover, this middleware must be placed after the
Marten::Middleware::Session in the Marten.settings.middleware array of middlewares.
Instance methods
Calls the middleware for a given HTTP request and returns a HTTP response.
This method must be implemented by subclasses: it takes a request argument (the current HTTP request) and a
get_response proc that allows to get the final response. This proc might actually call the next middleware in
the chain of configured middlewares, or the final matched handler. That way, the current middleware have the
ability to intercept any incoming request and the associated response, and to modify them if applicable.