Skip to content

Instantly share code, notes, and snippets.

@dgmike
Created June 23, 2015 10:53
Show Gist options
  • Select an option

  • Save dgmike/f3fe9a1e418d2875f7f1 to your computer and use it in GitHub Desktop.

Select an option

Save dgmike/f3fe9a1e418d2875f7f1 to your computer and use it in GitHub Desktop.
Rails: Retrieve all routes
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