demarches-normaliennes/app/components/dsfr/sidemenu_component.rb

17 lines
338 B
Ruby
Raw Normal View History

class Dsfr::SidemenuComponent < ApplicationComponent
renders_many :links, "LinkComponent"
class LinkComponent < ApplicationComponent
2023-04-24 15:13:51 +02:00
attr_reader :name, :url, :icon
def initialize(name:, url:, icon: nil)
@name = name
@url = url
2023-04-24 15:13:51 +02:00
@icon = icon
end
end
def active?(url)
current_page?(url)
end
end