formula 0.2.9 → 0.3.0
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/formula.rb +6 -4
- data/lib/formula/version.rb +1 -1
- metadata +1 -1
data/lib/formula.rb
CHANGED
@@ -70,7 +70,7 @@ module Formula
|
|
70
70
|
# Equivalent:
|
71
71
|
#
|
72
72
|
# <div class="block">
|
73
|
-
# <%= f.submit(
|
73
|
+
# <%= f.submit("Save")
|
74
74
|
# </div>
|
75
75
|
|
76
76
|
def button(value = nil, options = {})
|
@@ -109,12 +109,14 @@ module Formula
|
|
109
109
|
# <div class="error">...</div>
|
110
110
|
# </div>
|
111
111
|
|
112
|
-
def block(method, options = {}, &block)
|
113
|
-
options[:error] ||= error(method)
|
112
|
+
def block(method = nil, options = {}, &block)
|
113
|
+
options[:error] ||= error(method) if method
|
114
114
|
|
115
115
|
components = "".html_safe
|
116
116
|
|
117
|
-
|
117
|
+
if method
|
118
|
+
components << self.label(method, options[:label]) if options[:label] or options[:label].nil? and method
|
119
|
+
end
|
118
120
|
|
119
121
|
components << @template.capture(&block)
|
120
122
|
|
data/lib/formula/version.rb
CHANGED