Skip to content

Commit

Permalink
Merge pull request #1987 from DFE-Digital/error-no-namespace
Browse files Browse the repository at this point in the history
Set namespace correctly for errors
  • Loading branch information
thomasleese authored Feb 14, 2024
2 parents faaad35 + 45c56e4 commit b3b9c40
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/controllers/errors_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ErrorsController < ApplicationController
include EligibilityCurrentNamespace
# frozen_string_literal: true

class ErrorsController < ApplicationController
skip_before_action :verify_authenticity_token

def forbidden
Expand All @@ -24,4 +24,17 @@ def internal_server_error
formats: :html,
status: :internal_server_error
end

def current_namespace
path = request.original_fullpath
if path.starts_with?("/assessor")
"assessor"
elsif path.starts_with?("/support")
"support"
elsif path.starts_with?("/teacher")
"teacher"
else
"eligibility"
end
end
end

0 comments on commit b3b9c40

Please sign in to comment.