class method
self.normalize_path
Ruby on Rails 5.2.8.1
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 391
def self.normalize_path(path)
path = Journey::Router::Utils.normalize_path(path)
path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/(\(+[^)]+\)){1,}$}
path
end
Defined in actionpack/lib/action_dispatch/routing/mapper.rb line 391
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Routing::Mapper