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"}
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"}
| auth_options = { | |
| bearer_token_file: "/var/run/secrets/kubernetes.io/serviceaccount/token" | |
| } | |
| ssl_options = { | |
| ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" | |
| } | |
| control_client = Kubeclient::Client.new \ | |
| "https://kubernetes.default.svc", |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>animation test</title> | |
| <style> | |
| body { | |
| text-align: center; | |
| font-family: 'Courier New', Courier, monospace; | |
| } |
Given an application path like /github/github/issues, use the following to get the controller and action:
irb(main):001:0> Rails.application.routes.recognize_path "/github/github/issues", method: "GET"
=> {:controller=>"issues", :action=>"index", :user_id=>"github", :repository=>"github"}
The /github/github/issues path maps to issues#index (the index action on the IssuesController).