-2

In Rails would it be correct that where ever two tables are connected in a 1:M relationship there should be a corresponding nested route in the routes config file?

Dercni
  • 1,216
  • 3
  • 18
  • 38

1 Answers1

0

No, this is not a strict requirements. Routes depends on the logic of your application.

If Post belongs to Blog, it doesn't mean you can't have a top-level route for Post where (for instance) you aggregate all the posts.

It's common to have nested routes in case of a 1:M association because of the logical way resources are accessed. But this is not a strict requirement.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364