# File lib/action_dispatch/routing/mapper.rb, line 238 def self.normalize_name(name) normalize_path(name)[1..-1].gsub("/", "_") end
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.
# File lib/action_dispatch/routing/mapper.rb, line 232 def self.normalize_path(path) path = Journey::Router::Utils.normalize_path(path) path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[^)]+\)$} path end