filter_form 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/assets/javascripts/filter_form.js.coffee +0 -4
- data/lib/filter_form/input_options_builder.rb +3 -3
- data/lib/filter_form/simple_form/form_builder.rb +1 -3
- data/lib/filter_form/version.rb +1 -1
- data/lib/filter_form.rb +2 -2
- metadata +2 -3
- data/lib/assets/stylesheets/filter_form.css.sass +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc3b4775806fecc4cdcde6e2f62c26a567e55012
|
4
|
+
data.tar.gz: 2526ef6636939739a41130225a1f9c6a6727fc6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69188707aa466a560b540c5e0916510869c5f8535098d5c53e3cf7cb19568d63daed96a421bf543f90bdf20ebde5c4d52661ed2a0465ac1e2e0f0f2a652f2449
|
7
|
+
data.tar.gz: 117885065cd8d362b161b10832f1b383efe39cb910ecf89768e261328ae802a0b299511ec316378037bd06f1cda721dce5a2e7d06bdadb8cb333efde7e4c603a
|
data/README.md
CHANGED
@@ -65,16 +65,21 @@ Of course you can customize your filter, like:
|
|
65
65
|
<% end %>
|
66
66
|
```
|
67
67
|
|
68
|
-
If you want to use jQuery [Datepicker](http://jqueryui.com/datepicker/) for `date` and `datetime` automatically or [Select2](http://ivaynberg.github.io/select2/),
|
68
|
+
If you want to use jQuery [Datepicker](http://jqueryui.com/datepicker/) for `date` and `datetime` automatically or [Select2](http://ivaynberg.github.io/select2/), add to your application.js file:
|
69
69
|
|
70
70
|
```js
|
71
|
+
//= require jquery
|
72
|
+
//= require jquery.ui.datepicker
|
73
|
+
//= require select2
|
74
|
+
|
71
75
|
//= require filter_form
|
72
76
|
```
|
73
77
|
|
74
78
|
And application.css:
|
75
79
|
|
76
80
|
```css
|
77
|
-
*= require
|
81
|
+
*= require jquery.ui.datepicker
|
82
|
+
*= require select2
|
78
83
|
```
|
79
84
|
|
80
85
|
### Other sources
|
@@ -14,7 +14,7 @@ module FilterForm
|
|
14
14
|
attr_accessor :attribute_name, :object, :custom_predicate, :custom_type
|
15
15
|
|
16
16
|
def build(options)
|
17
|
-
input_options_class.new(attribute_name: attribute_name, object: object, predicate: predicate, options: options)
|
17
|
+
input_options_class.new(attribute_name: attribute_name, object: object, predicate: predicate, options: options).filter_form_input_options
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
@@ -63,7 +63,7 @@ module FilterForm
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
def
|
66
|
+
def belongs_to?
|
67
67
|
object.klass.reflections[attribute_name] && object.klass.reflections[attribute_name].belongs_to?
|
68
68
|
end
|
69
69
|
|
@@ -72,7 +72,7 @@ module FilterForm
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def attribute_type
|
75
|
-
if
|
75
|
+
if belongs_to?
|
76
76
|
:belongs_to
|
77
77
|
elsif money?
|
78
78
|
:money
|
@@ -8,9 +8,7 @@ module SimpleForm
|
|
8
8
|
custom_type: options.delete(:as),
|
9
9
|
custom_predicate: options.delete(:predicate)
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
input(attribute_name, filter_form_input_options.simple_form_options, &block)
|
11
|
+
input(attribute_name, input_options_builder.build(options), &block)
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
data/lib/filter_form/version.rb
CHANGED
data/lib/filter_form.rb
CHANGED
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
|
+
version: 0.3.0
|
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-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_form
|
@@ -107,7 +107,6 @@ files:
|
|
107
107
|
- Rakefile
|
108
108
|
- filter_form.gemspec
|
109
109
|
- lib/assets/javascripts/filter_form.js.coffee
|
110
|
-
- lib/assets/stylesheets/filter_form.css.sass
|
111
110
|
- lib/filter_form.rb
|
112
111
|
- lib/filter_form/form_helper.rb
|
113
112
|
- lib/filter_form/input_options/base.rb
|