method

call

Importance_0
v3.0.0 - Show latest stable - 0 notes - Class: ActionDispatch::Flash
call(env) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/middleware/flash.rb, line 177
    def call(env)
      if (session = env['rack.session']) && (flash = session['flash'])
        flash.sweep
      end

      @app.call(env)
    ensure
      session    = env['rack.session'] || {}
      flash_hash = env['action_dispatch.request.flash_hash']

      if flash_hash && (!flash_hash.empty? || session.key?('flash'))
        session["flash"] = flash_hash
      end

      if session.key?('flash') && session['flash'].empty?
        session.delete('flash')
      end
    end
Register or log in to add new notes.