formula 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/formula.rb +27 -1
- data/lib/formula/railtie.rb +1 -0
- metadata +2 -2
data/lib/formula.rb
CHANGED
@@ -4,9 +4,35 @@ module Formula
|
|
4
4
|
|
5
5
|
class FormulaFormBuilder < ActionView::Helpers::FormBuilder
|
6
6
|
|
7
|
-
def input(method, options = {})
|
7
|
+
def input(method, options = {}, &block)
|
8
8
|
end
|
9
|
+
|
10
|
+
def association(method, options = {}, &block)
|
11
|
+
end
|
12
|
+
|
13
|
+
def formula_fields_for(record_or_name_or_array, *args, &block)
|
14
|
+
options = args.extract_options!
|
15
|
+
options[:builder] ||= self.class
|
16
|
+
fields_for(record_or_name_or_array, *(args << options), &block)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
9
20
|
|
21
|
+
module FormulaFormHelper
|
22
|
+
@@builder = ::Formula::FormulaFormBuilder
|
23
|
+
|
24
|
+
def formula_form_for(record_or_name_or_array, *args, &proc)
|
25
|
+
options = args.extract_options!
|
26
|
+
options[:builder] ||= @@builder
|
27
|
+
form_for(record_or_name_or_array, *(args << options), &proc)
|
28
|
+
end
|
29
|
+
|
30
|
+
def formula_fields_for(record_or_name_or_array, *args, &block)
|
31
|
+
options = args.extract_options!
|
32
|
+
options[:builder] ||= @@builder
|
33
|
+
fields_for(record_or_name_or_array, *(args << options), &block)
|
34
|
+
end
|
35
|
+
|
10
36
|
end
|
11
37
|
|
12
38
|
end
|
data/lib/formula/railtie.rb
CHANGED