better_form 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/better_form/version.rb +1 -1
- data/lib/better_form/view_helper.rb +11 -0
- metadata +1 -1
data/lib/better_form/version.rb
CHANGED
@@ -15,6 +15,17 @@ module BetterForm
|
|
15
15
|
form_for(record_or_name_or_array, *(args << options), &proc)
|
16
16
|
end
|
17
17
|
|
18
|
+
def better_fields_for(record_or_name_or_array, *args, &proc)
|
19
|
+
options = args.extract_options!.reverse_merge(:builder => BetterForm::Builder)
|
20
|
+
|
21
|
+
# Extract the better_form specific 'label' and 'validate_all' options
|
22
|
+
@label_all = options.delete(:label)
|
23
|
+
@validate_all = options.delete(:validate)
|
24
|
+
|
25
|
+
# Call the standard Rails fields_for with our updated options
|
26
|
+
fields_for(record_or_name_or_array, *(args << options), &proc)
|
27
|
+
end
|
28
|
+
|
18
29
|
def label_all?
|
19
30
|
@label_all
|
20
31
|
end
|