Rails 3: I want to list all paths defined in my rails application

Viewed 147220

I want to list all defined helper path functions (that are created from routes) in my rails 3 application, if that is possible.

Thanks,

6 Answers

CLI

updated for version 6

To list all existing routes you'll want to run the command:

bundle exec rails routes

bundle exec will

Execute a command in the context of the bundle

and rails routes will

list all of your defined routes

Example

If you have your resource route declared like so:

resource :credential, only: [:new, :create, :destroy]

Then it's helpful to pipe the output so you can grep for your specific resource.

For example: bundle exec rails routes grep example

Related