Class: Ui::Select::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Ui::Select::Component
- Defined in:
- lib/uikit_rails/templates/components/select/component.rb
Overview
Styled native select dropdown.
Instance Attribute Summary collapse
-
#html_attrs ⇒ Object
readonly
Returns the value of attribute html_attrs.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options: [], prompt: nil, selected: nil, **html_attrs) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(options: [], prompt: nil, selected: nil, **html_attrs) ⇒ Component
Returns a new instance of Component.
9 10 11 12 13 14 15 |
# File 'lib/uikit_rails/templates/components/select/component.rb', line 9 def initialize(options: [], prompt: nil, selected: nil, **html_attrs) @options = @prompt = prompt @selected = selected @html_attrs = html_attrs super() end |
Instance Attribute Details
#html_attrs ⇒ Object (readonly)
Returns the value of attribute html_attrs.
7 8 9 |
# File 'lib/uikit_rails/templates/components/select/component.rb', line 7 def html_attrs @html_attrs end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/uikit_rails/templates/components/select/component.rb', line 7 def @options end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
7 8 9 |
# File 'lib/uikit_rails/templates/components/select/component.rb', line 7 def prompt @prompt end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
7 8 9 |
# File 'lib/uikit_rails/templates/components/select/component.rb', line 7 def selected @selected end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'lib/uikit_rails/templates/components/select/component.rb', line 17 def call content_tag(:select, , **computed_attrs) end |