How do I find all route helpers names in a Rails app?
All the route helpers names can be find inside Rails.application.routes, like this:
Rails.application.routes.named_routes.helper_names
It'also possible to get the path helpers only, or the url helpers only:
# path_helpers Rails.application.routes.named_routes.path_helpers_module.instance_methods
url_helpers
Rails.application.routes.named_routes.url_helpers_module.instance_methods
We came up with these solutions, but if anybody knows better let us know!
Sources:
Stackoverflow - In Rails, how to see all the “path” and “url” methods added by Rails's routing? (update: using Rails console)