Class: Phlexi::Form::Components::Label

Inherits:
Base
  • Object
show all
Defined in:
lib/phlexi/form/components/label.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #field

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Phlexi::Form::Components::Base

Instance Method Details

#view_templateObject



7
8
9
10
11
12
13
14
15
# File 'lib/phlexi/form/components/label.rb', line 7

def view_template
  label(**attributes) do
    if field.required?
      abbr(title: "required") { "*" }
      whitespace
    end
    plain field.label
  end
end