Class: StimulusPlumbers::Form::Fields::Group

Inherits:
Plumber::Base show all
Defined in:
lib/stimulus_plumbers/form/fields/group.rb

Constant Summary

Constants included from Plumber::HtmlOptions

Plumber::HtmlOptions::STIMULUS_SPACEJOIN_KEYS

Instance Attribute Summary

Attributes inherited from Plumber::Base

#template

Instance Method Summary collapse

Methods inherited from Plumber::Base

#initialize, #theme

Methods included from Plumber::HtmlOptions

#merge_data_options, #merge_html_options, #merge_string_option, #normalize_part

Constructor Details

This class inherits a constructor from StimulusPlumbers::Plumber::Base

Instance Method Details

#render(layout: :stacked, error: false, &block) ⇒ Object



7
8
9
10
# File 'lib/stimulus_plumbers/form/fields/group.rb', line 7

def render(layout: :stacked, error: false, &block)
  klass = theme.resolve(:form_group, layout: layout, error: error).fetch(:classes, "")
  template.(:div, class: klass.presence, &block)
end