sn_filterable 1.0.1 → 1.1.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b9cd4e29b1ae510d91132581e2bbd2f161ce990fc1e7ec6608d6f7bdb1b41c
|
4
|
+
data.tar.gz: 88eca5cf836c294bfb9853dc8bf321d63d7896115e6bdafc35faa8218c66f726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0ac7e1edc645cb96066facb446d424237abfb064c2143863a97cc88dbc758483f62be811403728fb0b14e3436a654877bbedcc9783c0b59e27a30b9c7b3c09b
|
7
|
+
data.tar.gz: 39991b7cfacb996f545bb0aae07a4f18a6c316ca65f884b78b2b5fe7f4082c8cab0bf6cabe208aafa870392f9be09d8a2c1b5c0dbefac70ede1d4986b97daed8
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ There are a couple key requirements for your app to be compatible with this gem:
|
|
20
20
|
Add this line to your application's Gemfile:
|
21
21
|
|
22
22
|
```ruby
|
23
|
-
gem "sn_filterable"
|
23
|
+
gem "sn_filterable"
|
24
24
|
```
|
25
25
|
|
26
26
|
And then execute:
|
@@ -70,7 +70,7 @@
|
|
70
70
|
</div>
|
71
71
|
<% end %>
|
72
72
|
|
73
|
-
<%= turbo_frame_tag @frame_id, "data-turbo-action": "advance" do %>
|
73
|
+
<%= turbo_frame_tag @frame_id, "data-turbo-action": @update_url_on_submit ? "advance" : nil do %>
|
74
74
|
<%= content_tag :input, "", type: "hidden", name: "sort", value: @filtered.queries["sort"] if @filtered.queries["sort"].present? %>
|
75
75
|
<%= content_tag :input, "", type: "hidden", name: "order", value: @filtered.queries["order"] if @filtered.queries["order"].present? %>
|
76
76
|
|
@@ -23,13 +23,15 @@ module SnFilterable
|
|
23
23
|
# @param [String, nil] url Optional, the base URL of where the filters are displayed
|
24
24
|
# @param [String, nil] search_filter_name Optional, enable's and set's the search filter, specified by the filter's parameter name
|
25
25
|
# @param [Boolean] show_sidebar If true, will show the sidebar with the filters.
|
26
|
-
|
26
|
+
# @param [Boolean] update_url_on_submit If true, will update the URL in the user's browser on form submission.
|
27
|
+
def initialize(frame_id:, filtered:, filters:, url: nil, search_filter_name: nil, show_sidebar: true, update_url_on_submit: true)
|
27
28
|
@frame_id = frame_id
|
28
29
|
@filtered = filtered
|
29
30
|
@filters = filters
|
30
31
|
@url = url
|
31
32
|
@search_filter_name = search_filter_name
|
32
33
|
@show_sidebar = show_sidebar
|
34
|
+
@update_url_on_submit = update_url_on_submit
|
33
35
|
end
|
34
36
|
|
35
37
|
def search_field
|
data/lib/sn_filterable/engine.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sn_filterable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chase McDougall
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: heroicon
|