The model layer of the last chapter is the first part of the Model-View-Controller jigsaw. Implementing a user interface on top of the model layer means building the two remaining MVC components (see the section Model-View-Controller Architecture at the start of Chapter 4):
Controllers, which handle the control flow and interact with the model layer
Views, which present data to the user and enable them to interact with the controllers
How do you decide which controllers and views do you need to build? Rails helps us with our decision making by suggesting a convention: one controller for each model. The controller for the model handles all of the operations on it; typically the CRUD operations, i.e.
Creating a new instance
Retrieving all the instances of the model
Updating an instance
Deleting an instance
Making a controller for each model seems a sensible place to start. In the rest of the chapter, we will build up the following controllers, corresponding to the models...