method
serve
v7.1.3.2 -
Show latest stable
-
0 notes -
Class: Router
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
serve(req)
public
Hide source
# File actionpack/lib/action_dispatch/journey/router.rb, line 31 def serve(req) find_routes(req) do |match, parameters, route| set_params = req.path_parameters path_info = req.path_info script_name = req.script_name unless route.path.anchored req.script_name = (script_name.to_s + match.to_s).chomp("/") req.path_info = match.post_match req.path_info = "/" + req.path_info unless req.path_info.start_with? "/" end tmp_params = set_params.merge route.defaults parameters.each_pair { |key, val| tmp_params[key] = val.force_encoding(::Encoding::UTF_8) } req.path_parameters = tmp_params req.route_uri_pattern = route.path.spec.to_s _, headers, _ = response = route.app.serve(req) if "pass" == headers[Constants::X_CASCADE] req.script_name = script_name req.path_info = path_info req.path_parameters = set_params next end return response end [404, { Constants::X_CASCADE => "pass" }, ["Not Found"]] end