Skip to content

Instantly share code, notes, and snippets.

@timoschilling
Created October 21, 2015 14:35
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 timoschilling/c7d16986aba79d678d33 to your computer and use it in GitHub Desktop.
Save timoschilling/c7d16986aba79d678d33 to your computer and use it in GitHub Desktop.
find Rails url helper name
def find_route_name(path)
Rails.application.routes.routes.select do |route|
route.path.match path
end.map(&:name).compact.first
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment