class AppProgrammeNavigationComponent
Constants
- SECTIONS
Public Class Methods
Source
# File app/components/app_programme_navigation_component.rb, line 4 def initialize(programme, academic_year, active:) @programme = programme @academic_year = academic_year @active = active end
Public Instance Methods
Source
# File app/components/app_programme_navigation_component.rb, line 10 def call render AppSecondaryNavigationComponent.new do |nav| SECTIONS.each do |section| action = section == :overview ? :show : :index nav.with_item( href: public_send("programme_#{section}_path", programme, academic_year), text: I18n.t("title", scope: [:programmes, section, action]), selected: active == section ) end end end