demarches-normaliennes/app/components/dsfr/sidemenu_component.rb
2023-05-31 11:38:16 +02:00

16 lines
338 B
Ruby

class Dsfr::SidemenuComponent < ApplicationComponent
renders_many :links, "LinkComponent"
class LinkComponent < ApplicationComponent
attr_reader :name, :url, :icon
def initialize(name:, url:, icon: nil)
@name = name
@url = url
@icon = icon
end
end
def active?(url)
current_page?(url)
end
end