Class: PhlexyUI::FormControl

Inherits:
Base
  • Object
show all
Defined in:
lib/phlexy_ui/form_control.rb

Instance Method Summary collapse

Methods inherited from Base

modifiers

Constructor Details

#initialize(as: :div) ⇒ FormControl

Returns a new instance of FormControl.



5
6
7
8
# File 'lib/phlexy_ui/form_control.rb', line 5

def initialize(*, as: :div, **)
  super(*, **)
  @as = as
end

Instance Method Details

#view_templateObject



10
11
12
13
14
15
16
17
# File 'lib/phlexy_ui/form_control.rb', line 10

def view_template(&)
  generate_classes!(
    component_html_class: "form-control",
    options:
  ).then do |classes|
    public_send(as, class: classes, **options, &)
  end
end