Skip to content

Instantly share code, notes, and snippets.

@chsh
Created July 24, 2015 15:55
Show Gist options
  • Save chsh/137afbf8d91a00dbf441 to your computer and use it in GitHub Desktop.
Save chsh/137afbf8d91a00dbf441 to your computer and use it in GitHub Desktop.
Get Rails routes list from own application.
# note: This code does not point correct paths on "initializer".
# Use after all initialization process are completed.
#
class GetRoutePaths
def self.list
@@list ||= Rails.application.routes.routes.map { |r| r.path.spec.to_s }.uniq
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment