when "controller" is created ?


Does anyone know when exactly the "controller" objects are created in
when the http server starts? or when it is answering a http request? or
thanks you very much.


The dispatcher will handle each request and a new controller
is instantiated by the routing system when a route is recognized.

In ActionController::Dispatcher, you've got this method :

      def handle_request
        @controller = Routing::Routes.recognize(@request)
        @controller.process(@request, @response).out(@output)

  -- Jean-François.