method
find_routes
v6.1.7.7 -
Show latest stable
- Class:
ActionDispatch::Journey::Router
find_routes(req)private
No documentation available.
# File actionpack/lib/action_dispatch/journey/router.rb, line 109
def find_routes(req)
path_info = req.path_info
routes = filter_routes(path_info).concat custom_routes.find_all { |r|
r.path.match?(path_info)
}
if req.head?
routes = match_head_routes(routes, req)
else
routes.select! { |r| r.matches?(req) }
end
routes.sort_by!(&:precedence)
routes.map! { |r|
match_data = r.path.match(path_info)
path_parameters = {}
match_data.names.each_with_index { |name, i|
val = match_data[i + 1]
path_parameters[name.to_sym] = Utils.unescape_uri(val) if val
}
[match_data, path_parameters, r]
}
end