Class: Forms::Plain::Control
- Inherits:
-
FormControl
- Object
- Phlex::HTML
- FormControl
- Forms::Plain::Control
- Defined in:
- lib/forms/plain/control.rb
Overview
The label + field + error/hint wrapper as a bare
, preserving
FormControl's ordering contract.
Instance Method Summary collapse
Methods inherited from FormControl
Constructor Details
This class inherits a constructor from Forms::FormControl
Instance Method Details
#view_template ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/forms/plain/control.rb', line 8 def view_template div(**@options.except(:class), class: @options[:class]) do render Label.new(text: @label, for: @field_id, required: @required) if @label yield if block_given? if @error render FieldError.new(message: @error) elsif @hint render FieldHint.new(text: @hint) end end end |