Permalink
Browse files

added will paginate to view and controller.

  • Loading branch information...
1 parent 53ea7e7 commit 6655171a91f30b232f908beaaab8afedca12b9ec @sabman committed Mar 4, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −1 app/controllers/users_controller.rb
  2. +4 −0 app/views/users/index.html.haml
@@ -3,7 +3,7 @@ class UsersController < ApplicationController
before_filter :correct_user, only: [:edit, :update]
def index
- @users = User.all
+ @users = User.paginate(page: params[:page])
end
def new
@@ -2,8 +2,12 @@
%h1 All users
+= will_paginate
+
%ul.users
- @users.each do |user|
%li
= gravatar_for(user, size: 30)
= link_to user.name, user
+
+= will_paginate

0 comments on commit 6655171

Please sign in to comment.