Module: TailwindForm::FormGroup

Extended by:
ActiveSupport::Concern
Included in:
FormBuilder
Defined in:
lib/tailwind_form/form_group.rb

Instance Method Summary collapse

Instance Method Details

#form_group(name, field_type = :text_field, classes = 'form__group') ⇒ Object



7
8
9
10
11
12
# File 'lib/tailwind_form/form_group.rb', line 7

def form_group(name, field_type = :text_field, classes = 'form__group')
  function_name = "#{field_type}_with_tailwind"
  tag.div(class: classes) do
    tailwind_label_field(name) + send(function_name, name, { class: 'form__input' })
  end
end