In this guide you will learn how controllers work and how they fit into the request cycle in your application. After the router has determined which controller to use for a request, the controller is
Rails validating search params for making sense of the request, and producing the appropriate output.
Luckily, Action Controller does most of the groundwork for you and uses smart conventions to make this as straightforward as possible. For most conventional RESTful applications, the controller will receive the request this is invisible to you as the developerfetch or save data from a model, and use a view to create HTML output. If your controller needs to do things a little differently, that's not a problem, this is just the most common way for a controller to work.
A controller can thus be thought as a middleman between models and views.