Created
May 14, 2022 00:52
-
-
Save igaiga/e54a03817384c345c44702fe9d3d8284 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app_routes = Rails.application.routes.routes | |
ActionDispatch::Routing::RoutesInspector.new(app_routes).send(:collect_routes, app_routes) | |
#=> | |
[{:name=>"books", | |
:verb=>"GET", | |
:path=>"/books(.:format)", | |
:reqs=>"books#index"}, | |
{:name=>"", | |
:verb=>"POST", | |
:path=>"/books(.:format)", | |
:reqs=>"books#create"}, | |
{:name=>"new_book", | |
:verb=>"GET", | |
:path=>"/books/new(.:format)", | |
:reqs=>"books#new"}, | |
{:name=>"edit_book", | |
:verb=>"GET", | |
:path=>"/books/:id/edit(.:format)", | |
:reqs=>"books#edit"}, | |
{:name=>"book", | |
:verb=>"GET", | |
:path=>"/books/:id(.:format)", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment