Ruby On Rails Lesson
A User has many Microposts
One of the most powerful features of Rails is the ability to form associations between different data models. In the case of our User model, each user potentially has many microposts. We can express this in code by updating the User and Micropost models as in Listing 2.10 and Listing 2.11.
Figure 2.14 Error messages for a failed micropost creation.