feat: customized page 404

This commit is contained in:
Colin Darie 2024-03-28 09:45:05 +01:00
parent fe508c0a73
commit 7dcd4ba538
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
11 changed files with 149 additions and 77 deletions

View file

@ -21,16 +21,7 @@ class ReleaseNotesController < ApplicationController
render "scrollable_list" if params[:page].present?
end
def nav_bar_profile
# detect context from referer, simple (no detection when refreshing the page)
params = Rails.application.routes.recognize_path(request&.referer)
controller_class = "#{params[:controller].camelize}Controller".safe_constantize
return if controller_class.nil?
controller_instance = controller_class.new
controller_instance.try(:nav_bar_profile)
end
def nav_bar_profile = try_nav_bar_profile_from_referrer
private