formula 0.2.5 → 0.2.6
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 -8
- data/lib/formula/version.rb +1 -1
- metadata +1 -1
data/lib/formula.rb
CHANGED
@@ -179,7 +179,6 @@ module Formula
|
|
179
179
|
def input(method, options = {})
|
180
180
|
options[:as] ||= as(method)
|
181
181
|
options[:input] ||= {}
|
182
|
-
options[:input][:html] ||= {}
|
183
182
|
|
184
183
|
self.block(method, options) do
|
185
184
|
@template.content_tag(::Formula.input_tag, :class => [::Formula.input_class, options[:as]]) do
|
@@ -193,10 +192,10 @@ module Formula
|
|
193
192
|
when :email then email_field method, options[:input]
|
194
193
|
when :phone then phone_field method, options[:input]
|
195
194
|
when :number then number_field method, options[:input]
|
196
|
-
when :date then date_select method, options[:input], options[:input]
|
197
|
-
when :time then time_select method, options[:input], options[:input]
|
198
|
-
when :datetime then datetime_select method, options[:input], options[:input]
|
199
|
-
when :select then select method, options[:choices], options[:input], options[:input]
|
195
|
+
when :date then date_select method, options[:input], options[:input].delete(:html) || {}
|
196
|
+
when :time then time_select method, options[:input], options[:input].delete(:html) || {}
|
197
|
+
when :datetime then datetime_select method, options[:input], options[:input].delete(:html) || {}
|
198
|
+
when :select then select method, options[:choices], options[:input], options[:input].delete(:html) || {}
|
200
199
|
end
|
201
200
|
end
|
202
201
|
end
|
@@ -253,13 +252,12 @@ module Formula
|
|
253
252
|
def association(method, collection, value, text, options = {})
|
254
253
|
options[:as] ||= :select
|
255
254
|
options[:association] ||= {}
|
256
|
-
options[:association][:html] ||= {}
|
257
255
|
|
258
256
|
self.block(method, options) do
|
259
257
|
@template.content_tag(::Formula.association_tag, :class => [::Formula.association_class, options[:as]]) do
|
260
258
|
case options[:as]
|
261
|
-
when :select then collection_select
|
262
|
-
options[:association], options[:association].delete(:html)
|
259
|
+
when :select then collection_select :"#{method}_id", collection, value, text,
|
260
|
+
options[:association], options[:association].delete(:html) || {}
|
263
261
|
end
|
264
262
|
end
|
265
263
|
end
|
data/lib/formula/version.rb
CHANGED