27.02.2013 Views

Rails%203%20In%20Action

Rails%203%20In%20Action

Rails%203%20In%20Action

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

This chapter covers<br />

� Expanding on the functionality of your app<br />

� Building a RESTful resource<br />

� Creating, updating, and deleting a resource<br />

83<br />

Oh CRUD!<br />

In chapter 3, you began writing stories for a CRUD (create, read, update, delete)<br />

interface for your Project resource. Here, you continue in that vein, beginning<br />

with writing a story for the R part of CRUD: reading. We often refer to reading as<br />

viewing in this and future chapters—we mean the same thing, but sometimes viewing<br />

is just a better word.<br />

For the remainder of the chapter, you’ll round out the CRUD interface for projects,<br />

providing your users with ways to edit, update, and delete projects too. Best of<br />

all, you’ll be doing this using behavior-driven development the whole way through.<br />

4.1 Viewing projects<br />

The show action generated for the story in chapter 3 was only half of this part of<br />

CRUD. The other part is the index action, which is responsible for showing a list of<br />

the projects. From this list, you can navigate to the show action for a particular project.<br />

The next story is about adding functionality to allow you to do that.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!