filter_form 0.7.11 → 0.7.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/filter_form/input_options/radio_buttons/base.rb +21 -0
- data/lib/filter_form/input_options_builder.rb +2 -0
- data/lib/filter_form/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dc1544d27c25dda57fc4200dc6c60a61f2fe4bc
|
4
|
+
data.tar.gz: 8b6a229ecc41f3c992cca64d5539eeb55954b411
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 165ff100d5de2ff86276401ec8b978d02288f51037850bd98cfb0917dc39322f89494144449f04f5ab864bdd5e3d83316f7a7aefc68f4497f96f1e89b7109bc6
|
7
|
+
data.tar.gz: 016b6ad35e2f075d398a19b5e36cf3354cb152156bd4f38fa604ec8a98179dd4b10f67884131b69ce1d81d2af874290c86bb7ca85d9dd6003062d964f06fa18e
|
data/README.md
CHANGED
@@ -60,6 +60,7 @@ In your view file:
|
|
60
60
|
`select` | `belongs_to`/`has_many`/`has_and_belongs_to_many` associations | `eq` | `select` |
|
61
61
|
`money` | [monetized](https://github.com/RubyMoney/money-rails) attribute | `eq` | `input[type="number"]` |
|
62
62
|
`check_boxes` | `any' | `in` | `input[type=checkbox]` |
|
63
|
+
`radio_buttons` | `any' | `eq` | `input[type=radio]` |
|
63
64
|
|
64
65
|
### Customization
|
65
66
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module FilterForm
|
2
|
+
module InputOptions
|
3
|
+
module RadioButtons
|
4
|
+
class Base < FilterForm::InputOptions::Base
|
5
|
+
include FilterForm::InputOptions::Shared::WithAssociations
|
6
|
+
|
7
|
+
DEFAULT_PREDICATE = :eq
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def additional_options
|
12
|
+
{
|
13
|
+
as: :radio_buttons,
|
14
|
+
collection: collection,
|
15
|
+
checked: input_value
|
16
|
+
}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -13,6 +13,8 @@ require 'filter_form/input_options/boolean/base'
|
|
13
13
|
|
14
14
|
require 'filter_form/input_options/checkbox/base'
|
15
15
|
|
16
|
+
require 'filter_form/input_options/radio_buttons/base'
|
17
|
+
|
16
18
|
module FilterForm
|
17
19
|
class InputOptionsBuilder
|
18
20
|
attr_accessor :attribute_name, :object, :custom_predicate, :custom_type
|
data/lib/filter_form/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filter_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeny Li
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/filter_form/input_options/checkbox/base.rb
|
145
145
|
- lib/filter_form/input_options/number/base.rb
|
146
146
|
- lib/filter_form/input_options/number/money.rb
|
147
|
+
- lib/filter_form/input_options/radio_buttons/base.rb
|
147
148
|
- lib/filter_form/input_options/select/base.rb
|
148
149
|
- lib/filter_form/input_options/shared/with_associations.rb
|
149
150
|
- lib/filter_form/input_options/string/base.rb
|