Created
February 28, 2023 14:51
-
-
Save sephraim/483578583271e16b99d17f62f09b5044 to your computer and use it in GitHub Desktop.
[Get all valid routes in Rails]
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
routes = Rails.application.routes.routes.map { |r| r.path.spec.to_s } | |
# *OR* for even more attributes | |
Rails.application.routes.routes.map { |r| { alias: r.name, path: r.path.spec.to_s, controller: r.defaults[:controller], action: r.defaults[:action] } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment