method
from_requirements
v8.0.0 -
Show latest stable
- Class:
ActionDispatch::Routing::RouteSet
from_requirements(requirements)public
Returns a Route matching the given requirements, or `nil` if none are found.
This is intended for use by tools such as Language Servers.
Given the routes are defined as:
resources :posts
Then the following will return the Route for the `show` action:
Rails.application.routes.from_requirements(controller: "posts", action: "show")