Module: ActionView::Helpers::FormHelper

Defined in:
lib/extensible_forms.rb

Instance Method Summary collapse

Instance Method Details

#field_set(object_name, name, content = nil, options = {}, &block) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/extensible_forms.rb', line 18

def field_set(object_name, name, content = nil, options = {}, &block)
  options.delete(:object)
  options[:name] ||= name
  options[:id] ||= name
  content ||= self.capture(&block) if block_given?
  ("fieldset", raw(content), options).html_safe
end

#fields_for_with_resource_form_builders(name, *args, &block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/extensible_forms.rb', line 8

def fields_for_with_resource_form_builders(name, *args, &block)
  name = singular_class_name(name) unless name.class.in?(String, Symbol)

  options = args.last.is_a?(Hash) ? args.last : {}
  options[:builder] ||= pick_form_builder(name)

  fields_for_without_resource_form_builders(name, *args, &block)
end