volt-pagination 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/pagination/controllers/main_controller.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 373ef27d71c2ca92b75dcff62c92ef113b7808d3
|
4
|
+
data.tar.gz: 2d55d969cdbbad4233afec8d93f2b62c7bfd7e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4804bb18efd502e2ce4488a649366a78c40b6c2fc2b0d6fac9333609c31a4a2c0191f922b798c5b87d5de2f4f0665db0f31563e73a6e57e8a97965e3ddee7c4
|
7
|
+
data.tar.gz: b5a300aeb3e643557ee663482342b4f3f3d5775fa4bf0b511f92f8db572a844d8a1e78b0444b57b1869d4ed8acf19615348f3a5d1dabd899cab604c9402c0465
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ To page a collection or query, simply use ```.skip``` and ```.limit```
|
|
20
20
|
Assuming a page size of 10:
|
21
21
|
|
22
22
|
def items_on_page
|
23
|
-
store._items.find({active: true}).skip((params._page
|
23
|
+
store._items.find({active: true}).skip((params._page || 1).to_i - 1) * 10).limit(10)
|
24
24
|
end
|
25
25
|
|
26
26
|
Then in your view you can add:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -51,19 +51,19 @@ module Pagination
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def window
|
54
|
-
attrs.window
|
54
|
+
(attrs.window || 5).to_i
|
55
55
|
end
|
56
56
|
|
57
57
|
def outer_window
|
58
|
-
attrs.outer_window
|
58
|
+
(attrs.outer_window || 1).to_i
|
59
59
|
end
|
60
60
|
|
61
61
|
def per_page
|
62
|
-
attrs.per_page
|
62
|
+
(attrs.per_page || 10).to_i
|
63
63
|
end
|
64
64
|
|
65
65
|
def current_page
|
66
|
-
params.send(:"_#{page_param_name}")
|
66
|
+
(params.send(:"_#{page_param_name}") || 1).to_i
|
67
67
|
end
|
68
68
|
|
69
69
|
def total_pages
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt-pagination
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: volt
|