Module: SimpleForm::Components::Wrapper
- Included in:
- Inputs::Base
- Defined in:
- lib/simple_form/components/wrapper.rb
Instance Method Summary collapse
- #wrap(content) ⇒ Object
- #wrapper_class ⇒ Object
- #wrapper_error_class ⇒ Object
- #wrapper_html_options ⇒ Object
- #wrapper_tag ⇒ Object
Instance Method Details
#wrap(content) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/simple_form/components/wrapper.rb', line 4 def wrap(content) if wrapper_tag && [:wrapper] != false template.content_tag(wrapper_tag, content, ) else content end end |
#wrapper_class ⇒ Object
16 17 18 |
# File 'lib/simple_form/components/wrapper.rb', line 16 def wrapper_class [:wrapper_class] || SimpleForm.wrapper_class end |
#wrapper_error_class ⇒ Object
20 21 22 |
# File 'lib/simple_form/components/wrapper.rb', line 20 def wrapper_error_class [:wrapper_error_class] || SimpleForm.wrapper_error_class end |
#wrapper_html_options ⇒ Object
24 25 26 27 28 29 |
# File 'lib/simple_form/components/wrapper.rb', line 24 def css_classes = input_html_classes.unshift(wrapper_class) css_classes << wrapper_error_class if has_errors? css_classes << disabled_class if disabled? (:wrapper, css_classes) end |
#wrapper_tag ⇒ Object
12 13 14 |
# File 'lib/simple_form/components/wrapper.rb', line 12 def wrapper_tag [:wrapper_tag] || SimpleForm.wrapper_tag end |