How I Memorized Rails Routes

Nancy Trinh
Oct 22 · 1 min read

We are asked to memorize the 7 default routes created when we define a single entry in the routing file, for example resources :posts.

This is how I memorized the 7 routes and the 4 helpers in the Rails guides:

I used posts as an example of a resource and reorganized the table shown in the guide in a way that makes sense to me.

There are 4 paths, 4 helpers, and 7 routes. I know the verbs (methods) under each path must be unique, i.e., there can’t be two GET requests to /posts that route to two different actions. I fill in the verbs first, then their associated actions.

Finally, I write down the order in which the actions appear, by convention, in the controller file.

Have you memorized the routes? If yes, how did you do it?

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade