Class: Railsboot::ListGroupComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/list_group_component.rb

Overview

ViewComponent: renders the list group block.

Instance Method Summary collapse

Constructor Details

#initialize(flush: false, **html_attributes) ⇒ ListGroupComponent

Returns a new instance of ListGroupComponent.



6
7
8
9
10
11
12
13
14
15
# File 'app/components/railsboot/list_group_component.rb', line 6

def initialize(flush: false, **html_attributes)
  @flush = flush
  @html_attributes = html_attributes

  @html_attributes[:class] = class_names(
    "list-group",
    { "list-group-flush" => @flush },
    html_attributes.delete(:class)
  )
end