Module: Formular::Element::Modules::WrappedControl::InstanceMethods
- Defined in:
- lib/formular/element/modules/wrapped_control.rb
Instance Method Summary collapse
Instance Method Details
#error ⇒ Object
46 47 48 49 50 51 |
# File 'lib/formular/element/modules/wrapped_control.rb', line 46 def error return '' unless has_errors? [:content] = error_text builder.error().to_s end |
#hint ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/formular/element/modules/wrapped_control.rb', line 53 def hint return '' unless has_hint? [:content] = hint_text [:id] ||= hint_id builder.hint().to_s end |
#label ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/formular/element/modules/wrapped_control.rb', line 38 def label return '' unless has_label? [:content] = label_text [:labeled_control] = self builder.label().to_s end |
#wrapper(&block) ⇒ Object
33 34 35 36 |
# File 'lib/formular/element/modules/wrapped_control.rb', line 33 def wrapper(&block) wrapper_element = has_errors? ? :error_wrapper : :wrapper builder.send(wrapper_element, Attributes[[:wrapper_options]], &block) end |