dimples 4.1.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimples/pagination.rb +5 -0
- data/lib/dimples/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13bfba661f7417a6a86a91336c597101bb7a97c3
|
4
|
+
data.tar.gz: b8fc312c5062ecffcd9f8485e0d7c9cdc435c0ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 302bd5dc30845199cf12ecf01faaafa0efa3dccf0d3b22e9bb1ef1be0278fc6827149dc197066bfedf1c7a70159ff1e813705793b51493928ec58350d721e8c4
|
7
|
+
data.tar.gz: 1aecacab2a884e1826501c884eab647f994a96d9eee9fa1754441422af11ec4efd5526000469b2d02db558dba92ffa1761e2f99d598b0192a218bcc72bdbe0cd
|
data/lib/dimples/pagination.rb
CHANGED
@@ -69,6 +69,10 @@ module Dimples
|
|
69
69
|
@items.slice((page - 1) * @per_page, @per_page)
|
70
70
|
end
|
71
71
|
|
72
|
+
def current_page_url
|
73
|
+
@current_page != 1 ? "#{@url}#{@page_prefix}#{@current_page}" : @url
|
74
|
+
end
|
75
|
+
|
72
76
|
def first_page_url
|
73
77
|
@url
|
74
78
|
end
|
@@ -95,6 +99,7 @@ module Dimples
|
|
95
99
|
previous_page: @previous_page,
|
96
100
|
next_page: @next_page,
|
97
101
|
links: {
|
102
|
+
current_page: current_page_url,
|
98
103
|
first_page: first_page_url,
|
99
104
|
last_page: last_page_url,
|
100
105
|
previous_page: previous_page_url,
|
data/lib/dimples/version.rb
CHANGED