From b6e5b219a08881bb16a054f359649a62cb936ac4 Mon Sep 17 00:00:00 2001 From: Peter Yates Date: Thu, 16 Jan 2025 11:07:18 +0000 Subject: [PATCH] Add active_when to the admin nav settings This sets active to true for nav nodes when the beginning of the current_path matches the active when path. --- app/components/navigation/primary_navigation_component.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/navigation/primary_navigation_component.rb b/app/components/navigation/primary_navigation_component.rb index 7929ceb6..478414c4 100644 --- a/app/components/navigation/primary_navigation_component.rb +++ b/app/components/navigation/primary_navigation_component.rb @@ -33,8 +33,8 @@ def navigation_items { appropriate_body_user: [], dfe_staff_user: [ - { text: "Teachers", href: admin_teachers_path }, - { text: "Organisations", href: admin_organisations_path }, + { text: "Teachers", href: admin_teachers_path, active_when: '/admin/teachers' }, + { text: "Organisations", href: admin_organisations_path, active_when: '/admin/organisations' }, ], school_user: [ { text: "Your ECTs", href: schools_ects_home_path },