HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

rails routes — List routes in a Rails application. More information: <https://guides.rubyonrails.org/routing.html>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
rails routesrailscommandcliroutesmorelistapplication

Problem

How to use the rails routes command: List routes in a Rails application. More information: <https://guides.rubyonrails.org/routing.html>.

Solution

rails routes — List routes in a Rails application. More information: <https://guides.rubyonrails.org/routing.html>.

List all routes:
rails routes


List all routes in an expanded format:
rails routes {{[-E|--expanded]}}


List routes partially matching URL helper method name, HTTP verb, or URL path:
rails routes {{[-g|--grep]}} {{posts_path|GET|/posts}}


List routes that map to a specified controller:
rails routes {{[-c|--controller]}} {{posts|Posts|Blogs::PostsController}}

Code Snippets

List all routes

rails routes

List all routes in an expanded format

rails routes {{[-E|--expanded]}}

List routes partially matching URL helper method name, HTTP verb, or URL path

rails routes {{[-g|--grep]}} {{posts_path|GET|/posts}}

List routes that map to a specified controller

rails routes {{[-c|--controller]}} {{posts|Posts|Blogs::PostsController}}

Context

tldr-pages: common/rails routes

Revisions (0)

No revisions yet.