diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-11-22 21:54:01 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-11-22 21:54:01 -0800 |
commit | ede97c6bb55049b31d6f5114cecd4d5105b80577 (patch) | |
tree | a586fc3af40bbcb892407f2fd2d70ea9e8d231e8 /actionpack/lib | |
parent | 165d27440b0775ef29ea8a8da700fab3683b9805 (diff) | |
parent | 46041c520809714b3937e7c79c2f220018a4a111 (diff) | |
download | rails-ede97c6bb55049b31d6f5114cecd4d5105b80577.tar.gz rails-ede97c6bb55049b31d6f5114cecd4d5105b80577.tar.bz2 rails-ede97c6bb55049b31d6f5114cecd4d5105b80577.zip |
Merge pull request #17715 from tgxworld/fix_nil_anchor
Anchor should not be appended when set to nil/false.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 6b8dcaf497..22c0de2ac2 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -68,7 +68,9 @@ module ActionDispatch end def add_anchor(path, anchor) - path << "##{Journey::Router::Utils.escape_fragment(anchor.to_param.to_s)}" + if anchor + path << "##{Journey::Router::Utils.escape_fragment(anchor.to_param)}" + end end def extract_domain_from(host, tld_length) |