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