Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jdennes
Last active January 21, 2021 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdennes/531257713806a6a68f37ff7a1649e122 to your computer and use it in GitHub Desktop.
Save jdennes/531257713806a6a68f37ff7a1649e122 to your computer and use it in GitHub Desktop.
Easily get Rails controller and action from a route

Easily get Rails controller and action from a route:

irb(main):001:0> Rails.application.routes.recognize_path "/github/github/issues", method: "GET"
=> {:controller=>"issues", :action=>"index", :user_id=>"github", :repository=>"github"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment