alphabetical_paginate 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -0
- data/lib/alphabetical_paginate/array.rb +1 -1
- data/lib/alphabetical_paginate/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -41,6 +41,15 @@ class UsersController < ApplicationController
|
|
41
41
|
end
|
42
42
|
```
|
43
43
|
|
44
|
+
You may want to sort by the same field that you paginated by (cannot be done in gem due to technical limitaitons).
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
def index
|
48
|
+
@users, @alphaParams = User.all.alpha_paginate(params[:letter]){|user| user.name}
|
49
|
+
@users.sort_by_name!
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
44
53
|
### View
|
45
54
|
You need to call `alphabetical_paginate` that we just generated in the controller (i.e `<%= alphabetical_paginate @alphaParams %>`) in the view, whereever you would like to render the pagination selector div. You also **must wrap the content you want paginated in a div with id="pagination_table"**.
|
46
55
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphabetical_paginate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|