Skip to Content
Rails 4 in Action
book

Rails 4 in Action

by Yehuda Katz, Rebecca Skinner, Stephen Klabnik, Ryan Bigg
August 2015
Intermediate to advanced content levelIntermediate to advanced
576 pages
18h 13m
English
Manning Publications
Content preview from Rails 4 in Action

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Rails Crash Course

Rails Crash Course

Anthony Lewis

Publisher Resources

ISBN: 9781617291098Publisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link