aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorsavroff <savroff@gmail.com>2017-06-19 18:01:20 -0400
committersavroff <savroff@gmail.com>2017-06-19 18:01:20 -0400
commit0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5 (patch)
tree90c4433343500ce20c42648ae2a1904091a239d5 /actionview/lib/action_view/helpers/url_helper.rb
parentb37aa68ff637c4ce1cfd9f6eaec659bc98a1e1b5 (diff)
downloadrails-0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5.tar.gz
rails-0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5.tar.bz2
rails-0c66c25ba4a92edcdd41a3eba31a208bdff3b2b5.zip
Fix current_page? helper issue with engine root path
Diffstat (limited to 'actionview/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb
index a6857101b9..b78c367921 100644
--- a/actionview/lib/action_view/helpers/url_helper.rb
+++ b/actionview/lib/action_view/helpers/url_helper.rb
@@ -552,7 +552,10 @@ module ActionView
request_uri = url_string.index("?") || check_parameters ? request.fullpath : request.path
request_uri = URI.parser.unescape(request_uri).force_encoding(Encoding::BINARY)
- url_string.chomp!("/") if url_string.start_with?("/") && url_string != "/"
+ if url_string.start_with?("/") && url_string != "/"
+ url_string.chomp!("/")
+ request_uri.chomp!("/")
+ end
if %r{^\w+://}.match?(url_string)
url_string == "#{request.protocol}#{request.host_with_port}#{request_uri}"