ransack_memory 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: abefb2da0c94c8caee92ef550ca93bc48538e8a9
|
|
4
|
+
data.tar.gz: 442d357d0778cde47013f4f680721e0ff26bbe9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ceb4da1cd2186094774fac35ff3e697a7d7e716f40d00b949a1a32d2d7fa65087360cd8969178ad3a159f82f50d9a8af507b330ebf87a21e74b244e6f453e05b
|
|
7
|
+
data.tar.gz: 8b1bbacd8e909bb8746db3ffbc52dcbaa898764172339418c0ac6d79a05306d68978bd374f2b11e0b2d4c74cc40a8abff985605f18e0ec7f06edc178d28bef79
|
data/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Add this in your views where you have search forms. This is clear button, which
|
|
|
27
27
|
You can pass any of link attributes:
|
|
28
28
|
|
|
29
29
|
```erb
|
|
30
|
-
<%= clear_filter, class: 'btn btn-primary', data: {confirm: 'Really?', my_data: 'something'} %>
|
|
30
|
+
<%= clear_filter, title: 'Clear Filter', class: 'btn btn-primary', data: {confirm: 'Really?', my_data: 'something'} %>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## Configuration
|
|
@@ -36,8 +36,7 @@ Create file in config/initializers/ransack_memory.rb with this content:
|
|
|
36
36
|
|
|
37
37
|
```ruby
|
|
38
38
|
RansackMemory::Core.config = {
|
|
39
|
-
param: :q
|
|
40
|
-
link_label: 'Clear filter' # clear_filter link label
|
|
39
|
+
param: :q # this means the default Ransack param name for searching. You can change it
|
|
41
40
|
}
|
|
42
41
|
```
|
|
43
42
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<% if params[RansackMemory::Core.config[:param].presence || :q].present? %>
|
|
2
|
-
<%= link_to
|
|
2
|
+
<%= link_to opts[:title].presence || 'Clear filter', url_for + "?cancel_filter=true", opts.except(:title) %>
|
|
3
3
|
<% end %>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
- if params[RansackMemory::Core.config[:param].presence || :q].present?
|
|
2
|
-
= link_to
|
|
2
|
+
= link_to opts[:title] || 'Clear filter', url_for + "?cancel_filter=true", opts.except(:title)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ransack_memory
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Richard Lapiš
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-06-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Automatically save and load ransack's filtered params into session
|
|
14
14
|
email: richard.lapis@gmail.com
|