[Tech Note] How Does Rails Processes An Incoming Request?
In a Rails application, incoming requests are processed as follows:
- Incoming request is sent to a router.
- The request is divided into parts by the router (parsed) to identify a particular method (action) somewhere in the controller code.
- The router takes the first part as a controller name
- The router takes the second part as a method name (action).
- The action might look at data in the request itself or interact with the model or may invoke another action. Eventually, the action prepares information for the view.
- the view renders something to the user.
Categories: Development, Tech Notes