Rails Routes P.1 Understanding Route Structure

Steven Klavins
2 min readMar 14, 2021

One of the most confusing things I found whilst learning Rails was how to correctly use routes. It is my hope through this blog I can uncover some of the magic our routes.rb facilitates.

To list the existing routes in your project simply run

rails routes

When running this command your terminal will provide output similar to the screenshot below. You can refine your search to specific model names using a pipe, for example..

rails routes | grep blog

--

--

Steven Klavins

Hi, I’m Steven, most call me Steve! I’m a programmer, musician, and artist. This blog contains various tutorials and posts related to software development.