Class: UI::InputComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::InputComponent
- Includes:
- InputBehavior
- Defined in:
- app/view_components/ui/input_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(type: "text", placeholder: nil, value: nil, name: nil, id: nil, classes: "", **attributes) ⇒ InputComponent
constructor
A new instance of InputComponent.
Methods included from InputBehavior
#input_classes, #input_html_attributes
Constructor Details
#initialize(type: "text", placeholder: nil, value: nil, name: nil, id: nil, classes: "", **attributes) ⇒ InputComponent
Returns a new instance of InputComponent.
6 7 8 9 10 11 12 13 14 |
# File 'app/view_components/ui/input_component.rb', line 6 def initialize(type: "text", placeholder: nil, value: nil, name: nil, id: nil, classes: "", **attributes) @type = type @placeholder = placeholder @value = value @name = name @id = id @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'app/view_components/ui/input_component.rb', line 16 def call tag.input(**input_html_attributes.merge(@attributes)) end |