method
find_routes
v4.2.1 -
Show latest stable
- Class:
ActionDispatch::Journey::Router
find_routes(req)private
No documentation available.
# File actionpack/lib/action_dispatch/journey/router.rb, line 99
def find_routes req
routes = filter_routes(req.path_info).concat custom_routes.find_all { |r|
r.path.match(req.path_info)
}
routes =
if req.request_method == "HEAD"
match_head_routes(routes, req)
else
match_routes(routes, req)
end
routes.sort_by!(&:precedence)
routes.map! { |r|
match_data = r.path.match(req.path_info)
path_parameters = r.defaults.dup
match_data.names.zip(match_data.captures) { |name,val|
path_parameters[name.to_sym] = Utils.unescape_uri(val) if val
}
[match_data, path_parameters, r]
}
end