Sha256: 80de8fffd9818760dfa38153ac4e74a8822aa907395a82825a2bb9d8fb95a9c8
Contents?: true
Size: 411 Bytes
Versions: 32
Compression:
Stored size: 411 Bytes
Contents
# frozen_string_literal: true module PandaCms class MenuComponent < ViewComponent::Base attr_accessor :menu_item attr_accessor :children def initialize(name:, item_styles: "") @menu = PandaCms::Menu.find_by(name: name) @menu_items = @menu.menu_items.order(:lft) if @menu.present? @item_styles = item_styles end def render? @menu_items.present? end end end
Version data entries
32 entries across 32 versions & 1 rubygems