simple_form_ransack 0.0.16 → 0.0.17

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: d7503aa043a1137a17d483feb14508f2e3ed272b
4
- data.tar.gz: f4d9499bac8ea5bfb29bf7bce45c0069344f4c01
3
+ metadata.gz: 3aaf4e35c9ce8bb0bc878d9bd73aeba5da18042b
4
+ data.tar.gz: a566340fd4da98f5708d09250f1afbe669a9b4a1
5
5
  SHA512:
6
- metadata.gz: bc144ad51d2757b536d930c71c31ee80fc3122e31ee89d4d9d64c1dea73857158931d1388226678691f78496cdc98138bc2e68febd468a7b29969e6569349674
7
- data.tar.gz: 400993d49561a440c86d426293282d40493a30d3c60f5d226c22ff379ff06c5e6aee8fff1345201459e34df4f1bf159b7df2a5db1e34599d53648fb3fe791f81
6
+ metadata.gz: 7483ee3d9547a2500df735a6102c5168a1147b6bf5d7163f59adc2f32cdf148cd6dcb583cc20319976849ca7bc2bfbb6b5530a9bd09e6122d2270db4a3a4df0f
7
+ data.tar.gz: d2381a05775fff59855115a0e2916d7ff59447df685abd91b56e7e880b8bf214f4fff77c4e1f51c36155890a06a62d5c4dd9681f7bd0f71cd03c8adbf74bde3f
@@ -24,4 +24,30 @@ module SimpleFormRansackHelper
24
24
  yield form_proxy
25
25
  end
26
26
  end
27
+
28
+ def simple_search_fields_for(ransack, *args)
29
+ if args.last.is_a?(Hash)
30
+ opts = args.pop
31
+ else
32
+ opts = {}
33
+ end
34
+
35
+ opts[:url] = request.original_fullpath unless opts[:url]
36
+ opts[:method] = "get" unless opts[:method]
37
+ args << opts
38
+
39
+ model_class = ransack.klass
40
+ sample_model = model_class.new
41
+ ransack_params = ransack.instance_variable_get(:@_registered_params)
42
+
43
+ simple_fields_for(sample_model, *args) do |form|
44
+ form_proxy = SimpleFormRansack::FormProxy.new(
45
+ ransack: ransack,
46
+ form: form,
47
+ params: ransack_params
48
+ )
49
+
50
+ yield form_proxy
51
+ end
52
+ end
27
53
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleFormRansack
2
- VERSION = "0.0.16".freeze
2
+ VERSION = "0.0.17".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_ransack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-11 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails