class method
self.normalize_path
Ruby on Rails 6.0.6
Since v3.0.20Signature
self.normalize_path(path)
Invokes Journey::Router::Utils.normalize_path and ensure that (:locale) becomes (/:locale) instead of /(:locale). Except for root cases, where the latter is the correct one.
Parameters
-
pathreq
Source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 399
def self.normalize_path(path)
path = Journey::Router::Utils.normalize_path(path)
path.gsub!(%r{/(\(+)/?}, '\1/') unless %r{^/(\(+[^)]+\)){1,}$}.match?(path)
path
end
Defined in actionpack/lib/action_dispatch/routing/mapper.rb line 399
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Routing::Mapper