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 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
 
@@ -33,6 +33,6 @@ class Array
33
33
  end
34
34
  params[:availableLetters] = availableLetters.collect{|k,v| k.to_s}
35
35
  params[:currentField] = current_field
36
- return output.sort, params
36
+ return output, params
37
37
  end
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module AlphabeticalPaginate
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-18 00:00:00.000000000 Z
12
+ date: 2013-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler