actionset 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/action_set/helpers/export/path_for_helper.rb +23 -0
- data/lib/action_set/helpers/pagination/current_page_description_for_helper.rb +1 -1
- data/lib/action_set/helpers/pagination/path_for_helper.rb +2 -0
- data/lib/action_set/helpers/sort/path_for_helper.rb +4 -4
- data/lib/action_set/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cc1754eed05ab67bf65fe136f44a632ba04ea39
|
4
|
+
data.tar.gz: ba34642fd14eb52a4a06a878eeacc8f15f5a244e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c9e268b59574dc5ea13129989a742ed921ab866f7bb679a33bc219ed8569a7d627fa4e403604a7514cb00119b1128e12b7a7f05f7185cf39a87e012430b3abc
|
7
|
+
data.tar.gz: 8fae13323ed5efef44857f881cf1b65fb62293e1a7eaed4f922343741d8beb0fb1c5737acf3d0a2ef72b270e9983e1a71d82a178f18f0633da67540aa1410e16
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
v 0.5.1
|
2
|
+
- Fix the sorting path helper to only ever allow single-vector sorting
|
3
|
+
- Fix the pagination description helper to have proper HTML spacing
|
4
|
+
- Add an `export_path_for(format)` helper for generating a path
|
1
5
|
v 0.5.0
|
2
6
|
- Replace the use of `@filters` with the helper method `form_for_object_from_param(:filter)`
|
3
7
|
- Fix the pagination and sorting path helper methods to ensure they don't remove pre-existing params
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../params/current_helper'
|
4
|
+
|
5
|
+
module Export
|
6
|
+
module PathForHelper
|
7
|
+
include Params::CurrentHelper
|
8
|
+
|
9
|
+
def export_path_for(format)
|
10
|
+
url_for export_params_for(format)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def export_params_for(format)
|
16
|
+
current_params
|
17
|
+
.deep_merge(only_path: true,
|
18
|
+
transform: {
|
19
|
+
format: format
|
20
|
+
})
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -9,7 +9,7 @@ module Pagination
|
|
9
9
|
include Pagination::TotalPagesForHelper
|
10
10
|
|
11
11
|
def pagination_current_page_description_for(set)
|
12
|
-
description = "Page
|
12
|
+
description = "Page <strong>#{pagination_current_page_for(set)}</strong> of <strong>#{pagination_total_pages_for(set)}</strong>".html_safe
|
13
13
|
|
14
14
|
content_tag(:span,
|
15
15
|
description,
|
@@ -16,10 +16,10 @@ module Sort
|
|
16
16
|
|
17
17
|
def sort_params_for(attribute)
|
18
18
|
current_params
|
19
|
-
.
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
.merge(only_path: true,
|
20
|
+
sort: {
|
21
|
+
attribute => next_sort_direction_for(attribute)
|
22
|
+
})
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/action_set/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Margheim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeset
|
@@ -227,6 +227,7 @@ files:
|
|
227
227
|
- bin/setup
|
228
228
|
- config.ru
|
229
229
|
- lib/action_set.rb
|
230
|
+
- lib/action_set/helpers/export/path_for_helper.rb
|
230
231
|
- lib/action_set/helpers/helper_methods.rb
|
231
232
|
- lib/action_set/helpers/pagination/current_page_description_for_helper.rb
|
232
233
|
- lib/action_set/helpers/pagination/current_page_for_helper.rb
|