10.3 Manipulating Microposts

Having finished both the data modeling and display templates for
microposts, we now turn our attention to the interface for creating them
through the web. The result will be our third example of using an HTML
form to create a resource—in this case, a Microposts resource.7 In this
section, we’ll also see the first hint of a status feed—a notion brought
to full fruition in Chapter 11. Finally, as with users, we’ll make it
possible to destroy microposts through the web.

There is one break with past convention worth noting: the interface to
the Microposts resource will run principally through the Users and
StaticPages controllers, so we won’t need actions like new or edit in
the Microposts controller; we’ll only need create and destroy. This
means that the routes for the Microposts resource are unusually simple,
as seen in Listing 10.22. The code in Listing 10.22 leads in turn to the
RESTful routes shown in Table 10.2, which is a small subset of the full
set of routes seen in Table 2.3. Of course, this simplicity is a sign of
being more advanced, not less—we’ve come a long way since our reliance
on scaffolding in Chapter 2, and we no longer need most of its
complexity.