aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-06-26 10:46:24 +0100
committerJosé Valim <jose.valim@gmail.com>2010-06-26 12:02:29 +0200
commitd4e1a2ef0d35f322803284a980575fc31ff7b4b6 (patch)
tree48572a2b98f1c7453d7ec54d85ffcd6aafa4357c /actionpack/lib/action_dispatch/routing/mapper.rb
parent59b24ceb0c558715714e272737ca0ca06f6043d5 (diff)
downloadrails-d4e1a2ef0d35f322803284a980575fc31ff7b4b6.tar.gz
rails-d4e1a2ef0d35f322803284a980575fc31ff7b4b6.tar.bz2
rails-d4e1a2ef0d35f322803284a980575fc31ff7b4b6.zip
Support optional static segements as well [#4832 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index ca57c302ef..388f695187 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -194,7 +194,7 @@ module ActionDispatch
# for root cases, where the latter is the correct one.
def self.normalize_path(path)
path = Rack::Mount::Utils.normalize_path(path)
- path.sub!(%r{/(\(+)/?([^:]*):}, '\1/\2:') unless path =~ %r{^/\(+:.*\)$}
+ path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[^/]+\)$}
path
end