Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. User Microposts

Chapter 11. User Microposts

Chapter 10 saw the completion of the REST actions for the Users resource, so the time has finally come to add a second resource: user microposts.[1] These are short messages associated with a particular user, first seen in larval form in Chapter 2. In this chapter, we will make a full-strength version of the sketch from Section 2.3 by constructing the Micropost data model, associating it with the User model using the has_many and belongs_to methods, and then making the forms and partials needed to manipulate and display the results. In Chapter 12, we will complete our tiny Twitter clone by adding the notion of following users in order to receive a feed of their microposts.

[1] Technically, we treated sessions as a resource in Chapter 9, but they are not saved to the database the way users and microposts are.

If you’re using Git for version control, I suggest making a topic branch as usual:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial