filter_form 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/filter_form/input_options/base.rb +9 -0
- data/lib/filter_form/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d15e455964a95e853df84f34866dbbfd3453ddf8
|
4
|
+
data.tar.gz: 3a39ec88bc8f534a3943b0151edf4030dc2d9852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caf8b95a46bde654bd666b09fdcca90254eb549143817194f2f42ba38bd76b40c4d1abe94a95a82e73d37b68921460beabc30ebf4d6e076b3875a9567eed56dd
|
7
|
+
data.tar.gz: 128383934a1b6f074d97a402d79df42744ae07cff1f18e9afbd8c543718874748ba9f1cd0bc4a1d1b63ecca3e080128b0cd4f97d866e11dc5054d763289f86e6
|
@@ -14,6 +14,7 @@ module FilterForm
|
|
14
14
|
def default_options
|
15
15
|
{
|
16
16
|
required: false,
|
17
|
+
label: label,
|
17
18
|
input_html: additional_input_options.merge(options.delete(:input_html) || {})
|
18
19
|
}
|
19
20
|
end
|
@@ -39,6 +40,14 @@ module FilterForm
|
|
39
40
|
result
|
40
41
|
end
|
41
42
|
|
43
|
+
def label
|
44
|
+
if options[:predicate_selector]
|
45
|
+
attribute_name.to_s.titleize
|
46
|
+
else
|
47
|
+
"#{ attribute_name }_#{ Ransack::Translate.predicate(predicate) }".titleize
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
42
51
|
def current_predicate
|
43
52
|
if object_condition
|
44
53
|
object_condition.predicate.name
|
data/lib/filter_form/version.rb
CHANGED