Module: SimpleForm::Components::Wrapper

Included in:
Inputs::Base
Defined in:
lib/simple_form/components/wrapper.rb

Instance Method Summary collapse

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 && options[:wrapper] != false
    template.(wrapper_tag, content, wrapper_html_options)
  else
    content
  end
end

#wrapper_html_optionsObject



16
17
18
# File 'lib/simple_form/components/wrapper.rb', line 16

def wrapper_html_options
  html_options_for(:wrapper, input_type, required_class)
end

#wrapper_tagObject



12
13
14
# File 'lib/simple_form/components/wrapper.rb', line 12

def wrapper_tag
  options[:wrapper_tag] || SimpleForm.wrapper_tag
end