Class: Katalyst::Tables::Query::ModalComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
HtmlAttributes, Frontend
Defined in:
app/components/katalyst/tables/query/modal_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Frontend

#summary_table_with, #table_orderable_with, #table_pagination_with, #table_query_with, #table_selection_with, #table_with

Constructor Details

#initialize(collection:) ⇒ ModalComponent

Returns a new instance of ModalComponent.



15
16
17
18
19
# File 'app/components/katalyst/tables/query/modal_component.rb', line 15

def initialize(collection:, **)
  super(**)

  @collection = collection
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



13
14
15
# File 'app/components/katalyst/tables/query/modal_component.rb', line 13

def collection
  @collection
end

#urlObject (readonly)

Returns the value of attribute url.



13
14
15
# File 'app/components/katalyst/tables/query/modal_component.rb', line 13

def url
  @url
end

Instance Method Details

#before_renderObject



21
22
23
24
25
# File 'app/components/katalyst/tables/query/modal_component.rb', line 21

def before_render
  collection.suggestions.each_with_index do |suggestion, index|
    with_suggestion(suggestion:, index:)
  end
end