Skip to content

ezRAez/crud_related_models

This branch is 29 commits ahead of kevinmcalear/crud_related_models:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

653e86e · Jun 7, 2016

History

33 Commits
Jun 7, 2016
Jun 7, 2016
Jun 7, 2016
Feb 19, 2016
Nov 18, 2015

Repository files navigation

CRUDing Related Models

While we went in to CRUDing in depth with a single model, and we explored what it means to link, or relate, our models, we haven't shown you an example of some of the tools Rails gives us to CRUD related models.

The Rails Guides for ActiveRecord Associations has great information on how to do this! You need to read them! But they don't walk you through each step of implementing them in an app.

To that end, we have four examples/walkthroughs to show you about how to structure the models, views, controllers and routes when trying to CRUD resources whose structure depends upon their relations:

  1. 1:n (one-to-many) relationships: a Shelf has many Books.
  2. n:n (many-to-many) relationships: a Topic has and belongs to many Books.
  3. multiple named relationships: a User has many Books they've created, and habtm Books they've "favorited."
  4. self referential relationships:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 97.9%
  • Ruby 2.1%