better_form 0.6.1 → 0.6.2
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 +10 -10
- metadata +1 -1
data/lib/better_form/version.rb
CHANGED
@@ -2,17 +2,17 @@ module BetterForm
|
|
2
2
|
module ViewHelper
|
3
3
|
def better_form_for(record_or_name_or_array, *args, &proc)
|
4
4
|
options = args.extract_options!.reverse_merge(:builder => BetterForm::Builder)
|
5
|
-
options[:class] = "#{options[:class]} better_form"
|
6
|
-
@label_all = options[:label]
|
7
|
-
@validate_all = options[:validate]
|
8
|
-
form_for(record_or_name_or_array, *(args << options), &proc)
|
9
|
-
end
|
10
5
|
|
11
|
-
|
12
|
-
options
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
# Add the class 'better_form' to the list of classes for this form
|
7
|
+
options[:html] ||= {}
|
8
|
+
options[:html][:class] = "#{options[:html][:class]} better_form"
|
9
|
+
|
10
|
+
# Extract the better_form specific 'label' and 'validate_all' options
|
11
|
+
@label_all = options.delete(:label)
|
12
|
+
@validate_all = options.delete(:validate)
|
13
|
+
|
14
|
+
# Call the standard Rails form_for with our updated options
|
15
|
+
form_for(record_or_name_or_array, *(args << options), &proc)
|
16
16
|
end
|
17
17
|
|
18
18
|
def label_all?
|