Created
June 23, 2015 10:53
-
-
Save dgmike/f3fe9a1e418d2875f7f1 to your computer and use it in GitHub Desktop.
Rails: Retrieve all routes
This file contains hidden or 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
| Rails | |
| .application | |
| .routes | |
| .named_routes | |
| .sort_by(&:to_s) | |
| .collect do |_, route| | |
| [ | |
| route.name, | |
| [ | |
| route.path.spec.to_s, | |
| route.parts | |
| ] | |
| ] | |
| end.to_h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment