Method: Formation::Form::ClassMethods#fieldset

Defined in:
lib/formation/form.rb

#fieldset(name, options = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/formation/form.rb', line 25

def fieldset(name, options = {})
  if name.is_a? Hash
    options = name
    name = Formation::Util.underscore(options[:legend])
  end
  @_current_fieldset = (fieldsets[name] ||= Formation::Fieldset.new(name, options))
  elements << @_current_fieldset
  yield
  @_current_fieldset = nil
end