class ActionDispatch::Routing::Mapper
Constants
- URL_OPTIONS
Public Class Methods
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 405 def self.normalize_name(name) normalize_path(name)[1..-1].tr("/", "_") end
# 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 path =~ %r{^/(\(+[^)]+\)){1,}$} path end
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.
© 2004–2019 David Heinemeier Hansson
Licensed under the MIT License.