Class: TaoForm::Components::Select::MultipleResultComponent
- Inherits:
-
FieldComponent
- Object
- TaoOnRails::Components::Base
- FieldComponent
- TaoForm::Components::Select::MultipleResultComponent
- Defined in:
- lib/tao_form/components/select/multiple_result_component.rb
Instance Attribute Summary collapse
-
#choices ⇒ Object
readonly
Returns the value of attribute choices.
-
#field_options ⇒ Object
readonly
Returns the value of attribute field_options.
Attributes inherited from FieldComponent
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(view, builder, attribute_name, choices = nil, options = {}) ⇒ MultipleResultComponent
constructor
A new instance of MultipleResultComponent.
- #render(&block) ⇒ Object
Constructor Details
#initialize(view, builder, attribute_name, choices = nil, options = {}) ⇒ MultipleResultComponent
Returns a new instance of MultipleResultComponent.
8 9 10 11 12 13 |
# File 'lib/tao_form/components/select/multiple_result_component.rb', line 8 def initialize view, builder, attribute_name, choices = nil, = {} super view, builder, attribute_name, @choices = choices end |
Instance Attribute Details
#choices ⇒ Object (readonly)
Returns the value of attribute choices.
6 7 8 |
# File 'lib/tao_form/components/select/multiple_result_component.rb', line 6 def choices @choices end |
#field_options ⇒ Object (readonly)
Returns the value of attribute field_options.
6 7 8 |
# File 'lib/tao_form/components/select/multiple_result_component.rb', line 6 def @field_options end |
Class Method Details
.component_name ⇒ Object
28 29 30 |
# File 'lib/tao_form/components/select/multiple_result_component.rb', line 28 def self.component_name :multiple_select_result end |
Instance Method Details
#render(&block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tao_form/components/select/multiple_result_component.rb', line 15 def render &block if block_given? super elsif builder && attribute_name super { builder.select attribute_name, choices, , { disabled: [:disabled], multiple: true } } end end |