Commit 115250ff3e57b8480ae82d022b7d6bb4f4e93d6c
1 parent
ec51e940
Exists in
master
and in
1 other branch
Pagination fixed. WillPaginate Mongoid extension requires [per_page] param.
Showing
5 changed files
with
8 additions
and
4 deletions
Show diff stats
app/controllers/apps_controller.rb
@@ -8,7 +8,7 @@ class AppsController < ApplicationController | @@ -8,7 +8,7 @@ class AppsController < ApplicationController | ||
8 | end | 8 | end |
9 | 9 | ||
10 | def show | 10 | def show |
11 | - @errs = @app.errs.paginate | 11 | + @errs = @app.errs.paginate(:page => params[:page], :per_page => Err.per_page) |
12 | end | 12 | end |
13 | 13 | ||
14 | def new | 14 | def new |
app/controllers/errs_controller.rb
@@ -4,12 +4,12 @@ class ErrsController < ApplicationController | @@ -4,12 +4,12 @@ class ErrsController < ApplicationController | ||
4 | 4 | ||
5 | def index | 5 | def index |
6 | app_scope = current_user.admin? ? App.all : current_user.apps | 6 | app_scope = current_user.admin? ? App.all : current_user.apps |
7 | - @errs = Err.for_apps(app_scope).unresolved.ordered.paginate(:page => params[:page]) | 7 | + @errs = Err.for_apps(app_scope).unresolved.ordered.paginate(:page => params[:page], :per_page => Err.per_page) |
8 | end | 8 | end |
9 | 9 | ||
10 | def all | 10 | def all |
11 | app_scope = current_user.admin? ? App.all : current_user.apps | 11 | app_scope = current_user.admin? ? App.all : current_user.apps |
12 | - @errs = Err.for_apps(app_scope).ordered.paginate(:page => params[:page]) | 12 | + @errs = Err.for_apps(app_scope).ordered.paginate(:page => params[:page], :per_page => Err.per_page) |
13 | end | 13 | end |
14 | 14 | ||
15 | def show | 15 | def show |
app/controllers/users_controller.rb
@@ -6,7 +6,7 @@ class UsersController < ApplicationController | @@ -6,7 +6,7 @@ class UsersController < ApplicationController | ||
6 | before_filter :require_user_edit_priviledges, :only => [:edit, :update] | 6 | before_filter :require_user_edit_priviledges, :only => [:edit, :update] |
7 | 7 | ||
8 | def index | 8 | def index |
9 | - @users = User.paginate(:page => params[:page]) | 9 | + @users = User.paginate(:page => params[:page], :per_page => User.per_page) |
10 | end | 10 | end |
11 | 11 | ||
12 | def show | 12 | def show |
app/models/err.rb