formula 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/formula.rb +6 -8
  2. data/lib/formula/version.rb +1 -1
  3. 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][:html]
197
- when :time then time_select method, options[:input], options[:input][:html]
198
- when :datetime then datetime_select method, options[:input], options[:input][:html]
199
- when :select then select method, options[:choices], options[:input], options[:input][:html]
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(:"#{method}_id", collection, value, text,
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
@@ -1,3 +1,3 @@
1
1
  module Formula
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: formula
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.5
5
+ version: 0.2.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin Sylvestre