Class: DaisyUI::Item

Inherits:
BaseComponent show all
Defined in:
app/components/daisy_ui/item.rb

Instance Method Summary collapse

Constructor Details

#initialize(href: nil, **system_arguments) ⇒ Item

Returns a new instance of Item.



5
6
7
8
# File 'app/components/daisy_ui/item.rb', line 5

def initialize(href: nil, **system_arguments)
  @href = href
  super(**system_arguments)
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
# File 'app/components/daisy_ui/item.rb', line 10

def call
  tag.li do
    if @href
      tag.a(href: @href, class: system_arguments[:class]) { content }
    else
      content
    end
  end
end