method

call

rails latest stable - Class: ActionDispatch::Routing::RouteSet::Dispatcher

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.1.8) is shown here.

call(env)
public

No documentation available.

# File actionpack/lib/action_dispatch/routing/route_set.rb, line 30
        def call(env)
          params = env[PARAMETERS_KEY]

          # If any of the path parameters has an invalid encoding then
          # raise since it's likely to trigger errors further on.
          params.each do |key, value|
            next unless value.respond_to?(:valid_encoding?)

            unless value.valid_encoding?
              raise ActionController::BadRequest, "Invalid parameter: #{key} => #{value}"
            end
          end

          prepare_params!(params)

          # Just raise undefined constant errors if a controller was specified as default.
          unless controller = controller(params, @defaults.key?(:controller))
            return [404, {'X-Cascade' => 'pass'}, []]
          end

          dispatch(controller, params[:action], env)
        end