Based on my current understanding, if I were to describe how the various components of the rails application work together to respond to requests, I would say the following:
1) Routes determine which request URLs map to controller methods.
2) Controller methods receive information from models and transfer this information (in the form of global variables) to the corresponding presentation templates.
3) The data stored in global variables is used to create the final response to viewing templates.
In the above explanation, the relationships between several components are clear and irrefutable; namely:
1) controller routes and methods
2) controller methods and viewing patterns
In fact, the above ratios are 1-to-1.
However, the relation of model classes to their adjacent component type (i.e., to controllers) is not so clear. Yes, controllers extract information from models, but consider the following:
1) The controller does not have to extract information from the model, as would be the case with a static website.
2) The controller can extract information from several classes of models.
, , ? , , (, , ) , , ? , , , , , , , (, UserController User)?
, , "resources" RESTful RESTful . , - RESTful. RESTful . REST. . , , , , .
, . . User, , . , , User , . , , . , - (, 1--1) .
- , ?