diff options
Diffstat (limited to 'app/controllers/concerns/routable_actions.rb')
-rw-r--r-- | app/controllers/concerns/routable_actions.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/concerns/routable_actions.rb b/app/controllers/concerns/routable_actions.rb index afd110adcad..4199da9cdf5 100644 --- a/app/controllers/concerns/routable_actions.rb +++ b/app/controllers/concerns/routable_actions.rb @@ -24,15 +24,15 @@ module RoutableActions end end - def ensure_canonical_path(routable, requested_path) + def ensure_canonical_path(routable, requested_full_path) return unless request.get? canonical_path = routable.full_path - if canonical_path != requested_path - if canonical_path.casecmp(requested_path) != 0 - flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path." + if canonical_path != requested_full_path + if canonical_path.casecmp(requested_full_path) != 0 + flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_full_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path." end - redirect_to request.original_url.sub(requested_path, canonical_path) + redirect_to build_canonical_path(routable) end end end |