Welcome to mirror list, hosted at ThFree Co, Russian Federation.

routable_actions.rb « concerns « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6f16377a156f692fe018296ae5a688e73bb3ac2b (plain)
1
2
3
4
5
6
7
8
9
10
11
module RoutableActions
  extend ActiveSupport::Concern

  def ensure_canonical_path(routable, requested_path)
    return unless request.get?

    if routable.full_path != requested_path
      redirect_to request.original_url.sub(requested_path, routable.full_path)
    end
  end
end