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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ba17c92cfab5acf0f06e3b806295e51792f71cf
4
- data.tar.gz: 0e5b396897ede23f430c1d889a342453621fac43
3
+ metadata.gz: 61af5ef0d5917e255602f6569418187119a6f180
4
+ data.tar.gz: 1b30d938f722535d762a193b17463fc88a55d2b7
5
5
  SHA512:
6
- metadata.gz: 753b1d457e8548713aea1914312a384473e200d4d434e3b1b622ef1de9750f883607256ba8e89b12db35203e4485d0903da625140d54119a9fefb18804d306b0
7
- data.tar.gz: b58d8c0548ab36ae2941af0d8f90a3f97648ce2f4c7e091bff7bd375d571b9d28694d9b2340262552b2f9305709c3342a0f1001c304246530d45392de48cdcb7
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: :eq %>
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 [datepicker](http://jqueryui.com/datepicker/) for `date` and `datetime` automatically, just add to your application.js file:
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 jquery.ui.datepicker
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'
@@ -1,3 +1,7 @@
1
+ #= require jquery
2
+ #= require jquery.ui.datepicker
3
+ #= require select2
4
+
1
5
  $ ->
2
6
  $('.filter_form_date').datepicker
3
7
  dateFormat: 'yy-mm-dd'
@@ -0,0 +1,2 @@
1
+ //= require jquery.ui.datepicker
2
+ //= require select2
@@ -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[:as],
8
+ custom_type: options.delete(:as),
9
9
  custom_predicate: options[:predicate]
10
10
 
11
11
  options.reverse_merge!(input_builder.build.options)
@@ -1,3 +1,3 @@
1
1
  module FilterForm
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
data/lib/filter_form.rb CHANGED
@@ -5,5 +5,7 @@ require 'filter_form/ransack/search'
5
5
 
6
6
  module FilterForm
7
7
  class Engine < ::Rails::Engine
8
+ require 'jquery-rails'
9
+ require 'select2-rails'
8
10
  end
9
11
  end
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.7
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: jquery-rails
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: simple_form
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: ransack
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