Flowdock
method

find_routes

Importance_0
v6.1.3.1 - Show latest stable - 0 notes - Class: Router
find_routes(req) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.