I want to know what the api request route is.
Let's say, for example, api_v1_user_session _path is the route for /api/v1/users/sign_in url
If the request comes from /api/v1/users/sign_in How to find out what the route is. In this case, it should be api_v1_user_session _path
I tried the instructions below, but it gives the controller and action, but does not route.
Rails.application.routes.recognize_path('/api/v1/users/sign_in') => {:controller=>"api/v1/sessions", :action=>"new"}
Is there any method like this
Rails.application.routes.get_route('/api/v1/users/sign_in') => api_v1_user_session
How can I get this route from a URL or from a request object.
source share