O'Reilly logo

Rails 4 in Action: Revised Edition of Rails 3 in Action by Ryan Bigg, Yehuda Katz, Steve Klabnik, and Rebecca Skinner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Nested resources

This chapter covers

  • Nested routing helpers and named routes
  • Creating associations to link models together
  • Making tests more expressive using let and let!

The project resource CRUD was completed in chapter 4, so the next step is to set up the ability to create tickets within the scope of a given project. This chapter explores how to set up a nested resource in Rails, by defining routes for Ticket resources and creating a CRUD interface for them, all scoped under the project resource that you just created.

In this chapter, you’ll see how easy it is to retrieve all ticket records for a specific project and perform CRUD operations on them, mainly with the powerful associations interface that Rails provides through ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required