aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorrails-noob <rails-noob@github.com>2011-08-23 18:01:02 +0000
committerrails-noob <rails-noob@github.com>2011-09-06 15:26:19 +0000
commit43fbb1e6b822c54568cb762a435c9cfb3f97cdeb (patch)
treecb013be1e0cc5796239a5061ae8c599ede16ecbc /actionpack
parentcc90adfd2a171c5fc9f90f6a6506c5ac937efab3 (diff)
downloadrails-43fbb1e6b822c54568cb762a435c9cfb3f97cdeb.tar.gz
rails-43fbb1e6b822c54568cb762a435c9cfb3f97cdeb.tar.bz2
rails-43fbb1e6b822c54568cb762a435c9cfb3f97cdeb.zip
Fix bug #2579.
Avoids double slash at start of paths when mounting an engine at the root.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index a5c1501f61..8be0ce44f1 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -452,7 +452,9 @@ module ActionDispatch
prefix_options = options.slice(*_route.segment_keys)
# we must actually delete prefix segment keys to avoid passing them to next url_for
_route.segment_keys.each { |k| options.delete(k) }
- _routes.url_helpers.send("#{name}_path", prefix_options)
+ prefix = _routes.url_helpers.send("#{name}_path", prefix_options)
+ prefix = '' if prefix == '/'
+ prefix
end
end
end