Class: UI::Input
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::Input
- Includes:
- InputBehavior
- Defined in:
- app/components/ui/input.rb
Instance Method Summary collapse
-
#initialize(type: "text", placeholder: nil, value: nil, name: nil, id: nil, classes: "", **attributes) ⇒ Input
constructor
A new instance of Input.
- #view_template ⇒ Object
Methods included from InputBehavior
#input_classes, #input_html_attributes
Constructor Details
#initialize(type: "text", placeholder: nil, value: nil, name: nil, id: nil, classes: "", **attributes) ⇒ Input
Returns a new instance of Input.
6 7 8 9 10 11 12 13 14 |
# File 'app/components/ui/input.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
#view_template ⇒ Object
16 17 18 |
# File 'app/components/ui/input.rb', line 16 def view_template input(**input_html_attributes.deep_merge(@attributes)) end |