filter_form 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -5
- data/filter_form.gemspec +2 -1
- data/lib/assets/javascripts/filter_form.js.coffee +4 -0
- data/lib/assets/stylesheets/filter_form.css.sass +2 -0
- data/lib/filter_form/simple_form/form_builder.rb +1 -1
- data/lib/filter_form/version.rb +1 -1
- data/lib/filter_form.rb +2 -0
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61af5ef0d5917e255602f6569418187119a6f180
|
4
|
+
data.tar.gz: 1b30d938f722535d762a193b17463fc88a55d2b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6751e3a4c26d7b2cb544e56153b7f0640bab894cefc0e04c3579e68a963573344b1fc3fb831f620a026f83615c74f8c95b8d881388dccd2563efc115058f464
|
7
|
+
data.tar.gz: 6a0df1220993e23dc094cc829dcb0c272491bb636fccc0421837be3b0187462204390d97207e87821aa82fa226c843a8510211276e212b8f80a9fb00cf82279e
|
data/README.md
CHANGED
@@ -59,23 +59,21 @@ Of course you can customize your filter, like:
|
|
59
59
|
|
60
60
|
```erb
|
61
61
|
<%= filter_form_for @q do |f| %>
|
62
|
-
<%= f.filter_input :year, as: :select, collection: ((Date.today.year - 3)..(Date.today.year + 3)).to_a, predicate: :
|
62
|
+
<%= f.filter_input :year, as: :select, collection: ((Date.today.year - 3)..(Date.today.year + 3)).to_a, predicate: :not_eq %>
|
63
63
|
<%= f.button :submit %>
|
64
64
|
<% end %>
|
65
65
|
```
|
66
66
|
|
67
|
-
If you want to use jQuery [
|
67
|
+
If you want to use jQuery [Datepicker](http://jqueryui.com/datepicker/) for `date` and `datetime` automatically or [Select2](http://ivaynberg.github.io/select2/), just add to your application.js file:
|
68
68
|
|
69
69
|
```js
|
70
|
-
//= require jquery
|
71
|
-
//= require jquery.ui.datepicker
|
72
70
|
//= require filter_form
|
73
71
|
```
|
74
72
|
|
75
73
|
And application.css:
|
76
74
|
|
77
75
|
```css
|
78
|
-
*= require
|
76
|
+
*= require filter_form
|
79
77
|
```
|
80
78
|
|
81
79
|
### Other sources
|
data/filter_form.gemspec
CHANGED
@@ -17,9 +17,10 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_dependency 'jquery-rails'
|
21
20
|
spec.add_dependency 'simple_form'
|
22
21
|
spec.add_dependency 'ransack'
|
22
|
+
spec.add_dependency 'jquery-rails'
|
23
|
+
spec.add_dependency 'select2-rails'
|
23
24
|
|
24
25
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
26
|
spec.add_development_dependency 'rake'
|
@@ -5,7 +5,7 @@ module SimpleForm
|
|
5
5
|
def filter_input(attribute_name, options = {}, &block)
|
6
6
|
input_builder = FilterForm::InputBuilder.new attribute_name: attribute_name,
|
7
7
|
object: object,
|
8
|
-
custom_type: options
|
8
|
+
custom_type: options.delete(:as),
|
9
9
|
custom_predicate: options[:predicate]
|
10
10
|
|
11
11
|
options.reverse_merge!(input_builder.build.options)
|
data/lib/filter_form/version.rb
CHANGED
data/lib/filter_form.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.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeny Li
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2013-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: simple_form
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: ransack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '>='
|
@@ -39,7 +39,21 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: jquery-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: select2-rails
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - '>='
|
@@ -93,6 +107,7 @@ files:
|
|
93
107
|
- Rakefile
|
94
108
|
- filter_form.gemspec
|
95
109
|
- lib/assets/javascripts/filter_form.js.coffee
|
110
|
+
- lib/assets/stylesheets/filter_form.css.sass
|
96
111
|
- lib/filter_form.rb
|
97
112
|
- lib/filter_form/form_helper.rb
|
98
113
|
- lib/filter_form/input_builder.rb
|