Chapter 4. Oh, CRUD!
This chapter covers
- Building read, update, and delete functionality for projects
- Creating test data with Factory Girl
- Handling errors and rescuing exceptions
- Working with Sass and the asset pipeline
- Styling the application using Bootstrap
- Simplifying form markup with Simple Form
In chapter 3 you began writing stories for a CRUD (create, read, update, delete) interface for your Project model. Here you’ll continue in that vein, beginning with writing a story for the R part of CRUD: reading. We often refer to reading as viewing in this and future chapters—we mean the same thing, but sometimes viewing is a better word.
In the remainder of the chapter, you’ll round out the CRUD interface for projects, providing your users with ways to edit, update, and delete projects too. Best of all, you’ll do this using behavior-driven development (BDD) the whole way through, continuing your use of the RSpec and Capybara gems that you saw in the last chapter. This chapter’s length is a testament to exactly how quickly you can get some CRUD actions up and running on a resource with Ruby on Rails.