Class: Katalyst::Tables::Query::InputComponent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(form:, input: {}) ⇒ InputComponent

Returns a new instance of InputComponent.



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

def initialize(form:, input: {}, **)
  super(**)

  @form = form

  update_input_attributes(**input)
end

Instance Attribute Details

#formObject (readonly)

Returns the value of attribute form.



9
10
11
# File 'app/components/katalyst/tables/query/input_component.rb', line 9

def form
  @form
end

Instance Method Details

#collectionObject



26
27
28
# File 'app/components/katalyst/tables/query/input_component.rb', line 26

def collection
  form.object
end

#nameObject



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

def name
  query_attribute || raise(ArgumentError, "No query attribute. " \
                                          "Does your collection include Katalyst::Tables::Collection::Query?")
end