Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set namespace correctly for errors #1987

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading