Module: BetterForm::ViewHelper

Defined in:
lib/better_form/view_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) better_fields_for(record_or_name_or_array, *args, &proc)



11
12
13
14
15
16
# File 'lib/better_form/view_helper.rb', line 11

def better_fields_for(record_or_name_or_array, *args, &proc)
  options = args.extract_options!.reverse_merge(:builder => BetterForm::Builder)
  @label_all = options[:label]
  @validate_all = options[:validate]
  fields_for(record_or_name_or_array, *(args << options), &proc)
end

- (Object) better_form_for(record_or_name_or_array, *args, &proc)



3
4
5
6
7
8
9
# File 'lib/better_form/view_helper.rb', line 3

def better_form_for(record_or_name_or_array, *args, &proc)
  options = args.extract_options!.reverse_merge(:builder => BetterForm::Builder)
  options[:class] = "#{options[:class]} better_form"
  @label_all = options[:label]
  @validate_all = options[:validate]
  form_for(record_or_name_or_array, *(args << options), &proc)
end

- (Boolean) label_all?



18
19
20
# File 'lib/better_form/view_helper.rb', line 18

def label_all?
  @label_all
end

- (Boolean) validate_all?



22
23
24
# File 'lib/better_form/view_helper.rb', line 22

def validate_all?
  @validate_all
end