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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72ec8aa3c0d7466d80687239848d0e71ac1091a4
4
- data.tar.gz: d59e186f531264052324f54ad175fc5cc90a25a0
3
+ metadata.gz: cc3b4775806fecc4cdcde6e2f62c26a567e55012
4
+ data.tar.gz: 2526ef6636939739a41130225a1f9c6a6727fc6c
5
5
  SHA512:
6
- metadata.gz: 3ee9bd15ec95c1485d19f8e464a11647ddf35e0b307e77b1fcb67e4088da8c9a33b994424b21a11470aebc2f7cad8871bea64a0c1168eb915ae36fdd7dd02dc9
7
- data.tar.gz: 4bebe228358abc58495d3bf955c7cf616d1ad69e21a65fe5205f049e96d10cba5d634f15f84ba3520308af331c4a3f611c85db681fa5ba6c9c4f5a760d206e6c
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/), just add to your application.js file:
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 filter_form
81
+ *= require jquery.ui.datepicker
82
+ *= require select2
78
83
  ```
79
84
 
80
85
  ### Other sources
@@ -1,7 +1,3 @@
1
- #= require jquery
2
- #= require jquery.ui.datepicker
3
- #= require select2
4
-
5
1
  $ ->
6
2
  $('.filter_form_select2').select2()
7
3
 
@@ -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 association_belongs_to?
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 association_belongs_to?
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
- filter_form_input_options = input_options_builder.build(options)
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
@@ -1,3 +1,3 @@
1
1
  module FilterForm
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/filter_form.rb CHANGED
@@ -5,7 +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
+ require 'simple_form'
9
+ require 'ransack'
10
10
  end
11
11
  end
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.2.1
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-09 00:00:00.000000000 Z
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
@@ -1,2 +0,0 @@
1
- //= require jquery.ui.datepicker
2
- //= require select2