diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-06 09:10:39 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-09-06 09:10:39 -0700 |
commit | ef14a0ec8647010eed3a8006409739e6d42791a9 (patch) | |
tree | cd496b019481f666401ec65c581af55fdeffdc9a /actionpack/lib/action_dispatch/routing/mapper.rb | |
parent | 1e61f2603caaa2e608294b6e563fd2251e349eda (diff) | |
parent | 43fbb1e6b822c54568cb762a435c9cfb3f97cdeb (diff) | |
download | rails-ef14a0ec8647010eed3a8006409739e6d42791a9.tar.gz rails-ef14a0ec8647010eed3a8006409739e6d42791a9.tar.bz2 rails-ef14a0ec8647010eed3a8006409739e6d42791a9.zip |
Merge pull request #2577 from rails-noob/master
Fix double slash at start of paths when mounting an engine at the root.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 4 |
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 21dc5af486..4d65173f61 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 |