ActionController::Dispatcher


Files

Parent

Description

Dispatches requests to the appropriate controller and takes care of reloading the app after each request when Dependencies.load? is true.

Methods

Included Modules

Public Class methods

define_dispatcher_callbacks (cache_classes)

dispatch (cgi = nil, session_options = CgiRequest::DEFAULT_SESSION_OPTIONS, output = $stdout)

Backward-compatible class method takes CGI-specific args. Deprecated in favor of Dispatcher.new(output, request, response).dispatch.

failsafe_response (fallback_output, status, originating_exception = nil) {|| ...}

If the block raises, send status code as a last-ditch response.

new (output = $stdout, request = nil, response = nil)

to_prepare (identifier = nil, &block)

Add a preparation callback. Preparation callbacks are run before every request in development mode, and before the first request in production mode.

An optional identifier may be supplied for the callback. If provided, to_prepare may be called again with the same identifier to replace the existing callback. Passing an identifier is a suggested practice if the code adding a preparation block may be reloaded.

Public Instance methods

_call (env)

call (env)

checkin_connections ()

cleanup_application ()

Cleanup the application by clearing out loaded classes so they can be reloaded on the next request without restarting the server.

dispatch ()

dispatch_cgi (cgi, session_options)

dispatch_unlocked ()

flush_logger ()

mark_as_test_request! ()

reload_application ()

test_request? ()

Protected Instance methods

failsafe_rescue (exception)

handle_request ()