feat: customized page 404
This commit is contained in:
parent
fe508c0a73
commit
7dcd4ba538
11 changed files with 149 additions and 77 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue