LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rails-routes

Display URL routing table for Rails application

TLDR

List all routes in the application
$ rails routes
copy
Search for routes matching a pattern
$ rails routes -g [pattern]
copy
Show routes for a specific controller
$ rails routes -c [controller_name]
copy
Display routes in expanded format
$ rails routes --expanded
copy

SYNOPSIS

rails routes [-g pattern] [-c controller] [--expanded]

DESCRIPTION

rails routes displays all routes defined in the Rails application. Routes map incoming URLs to controller actions and are defined in config/routes.rb.The output shows the route name (used for URL helpers), HTTP verb, URL pattern, and the controller#action that handles the request. Named routes can be used with _path and _url suffixes in views and controllers.The grep option is useful for large applications with many routes. It searches across all columns, making it easy to find routes by URL pattern, controller name, or route helper name.

PARAMETERS

-g, --grep pattern

Filter routes by pattern (matches against name, verb, path, or controller#action)
-c, --controller name
Show routes for a specific controller only
--expanded, -E
Print routes in expanded table format (one attribute per line)
-h, --help
Show help information

CAVEATS

Must be run from within a Rails application directory. The command loads the application environment, which may take time for large applications.Routes are displayed in the order they are matched. The first matching route handles the request, so order matters when routes may overlap.

SEE ALSO

rails(1), rails-server(1), rake(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid