Files
cheatsheet-tldr/tldr/rails-routes
2025-09-05 00:19:23 +00:00

26 lines
596 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`