Skip to content

Instantly share code, notes, and snippets.

@dphilla
Created July 12, 2017 18:04
Show Gist options
  • Save dphilla/00e8419078b19cd85f8d680844cd37b1 to your computer and use it in GitHub Desktop.
Save dphilla/00e8419078b19cd85f8d680844cd37b1 to your computer and use it in GitHub Desktop.
Advanced Routing in Rails - Daniel Phillips
Why do we namespace things?
We namespace when we want to separate the available functionality for a certain type of User on an app, or when we don't want
to repeate information that isn't pertinent to every user on certain pages.
What is the difference between namespacing and scoping?
scoping allows use to define the module, as well as the prefix assignment, while namespacing assumes we want
those elements be the same.
When would we use one over the other?
if we wanted to be explicit with the route prefix for a certain purpose, we would scope; otherwise, we would use namespacing.
When should you use nested resources?
When we want a resource to have access to to the dynamic properties of a top-level resource.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment