filter_form 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86d4a000a3b09a1b6b855b024360d457c86aad5f
4
- data.tar.gz: 033bb10c05331663961be58e34bfc93fbc21cbb1
3
+ metadata.gz: 0b440c472101fe2f6148b6bbd267c8cb26b80a3f
4
+ data.tar.gz: 6a2887fd96c81e42e2a7fbf2a2a40373a20b2b7a
5
5
  SHA512:
6
- metadata.gz: 24d05c9e72b1b5631bf1bf98860ea934e1648957b5fe1281acba4417935fdbfa74d687a86076d7ce7b9569042bfdc388e9c30b2e3195ceba4a560aef96c27bde
7
- data.tar.gz: 6753bcd6241eec48b6ece01f5203dbe6ae372d424b14eb6b904a56c251a521c72270952f178ecd25e950eaa21c264a3ccf91f548d27dc5a7372bd32072d57a4d
6
+ metadata.gz: c5d26bfb90ac2d85ba545020d74779225fd98056e93ac0ced2cfac0d95417c6edcaf94f346961a2868feeb029ecccc53d492e1b395013138b05da536ff23b930
7
+ data.tar.gz: 824d7d344c077367ca4281fbd458627701889e3b94f58768ea0db9b537c099dcc0cf560e149876f8244e037cf9a437d0a7f56cda39bd9145b1f488c6b5d7c424
data/README.md CHANGED
@@ -39,6 +39,7 @@ In your view file:
39
39
  <%= f.filter_input :parents # collection %>
40
40
  <%= f.filter_input :birthday # date %>
41
41
  <%= f.filter_input :amount # money %>
42
+ <%= f.filter_input :married # boolean %>
42
43
  <%= f.button :submit %>
43
44
  <% end %>
44
45
  ```
@@ -55,6 +56,7 @@ In your view file:
55
56
  `belongs_to` | `belongs_to` association | `eq` | `select` |
56
57
  `collection` | `has_many` or `has_and_belongs_to_many` association | `eq` | `select` |
57
58
  `money` | `money` [monetized](https://github.com/RubyMoney/money-rails) attribute | `eq` | `input[type=text]` |
59
+ `boolean` | `boolean` | `true` | `input[type=checkbox]` |
58
60
 
59
61
  ### Customization
60
62
 
@@ -0,0 +1,16 @@
1
+ module FilterForm
2
+ module InputOptions
3
+ module Checkbox
4
+ class Base < FilterForm::InputOptions::Base
5
+ private
6
+
7
+ def additional_options
8
+ {
9
+ as: :boolean
10
+ }
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+
@@ -8,6 +8,8 @@ require 'filter_form/input_options/string/base'
8
8
  require 'filter_form/input_options/string/date'
9
9
  require 'filter_form/input_options/string/money'
10
10
 
11
+ require 'filter_form/input_options/checkbox/base'
12
+
11
13
  module FilterForm
12
14
  class InputOptionsBuilder
13
15
  include ActiveModel::Model
@@ -38,6 +40,8 @@ module FilterForm
38
40
  case type
39
41
  when :string
40
42
  :cont
43
+ when :boolean
44
+ :true
41
45
  else
42
46
  :eq
43
47
  end
@@ -61,6 +65,8 @@ module FilterForm
61
65
  'select/collection'
62
66
  when :select2
63
67
  'select/select2'
68
+ when :boolean
69
+ 'checkbox/base'
64
70
  else
65
71
  _type
66
72
  end
@@ -1,3 +1,3 @@
1
1
  module FilterForm
2
- VERSION = '0.4.9'
2
+ VERSION = '0.4.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filter_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-22 00:00:00.000000000 Z
11
+ date: 2013-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_form
@@ -111,6 +111,7 @@ files:
111
111
  - lib/filter_form.rb
112
112
  - lib/filter_form/form_helper.rb
113
113
  - lib/filter_form/input_options/base.rb
114
+ - lib/filter_form/input_options/checkbox/base.rb
114
115
  - lib/filter_form/input_options/select/base.rb
115
116
  - lib/filter_form/input_options/select/belongs_to.rb
116
117
  - lib/filter_form/input_options/select/collection.rb