Refactored items_per_page. Start on admin/workgroups.

This commit is contained in:
benni 2011-06-10 12:18:55 +02:00
parent 689cfcfe01
commit 6ddef7267a
13 changed files with 35 additions and 119 deletions

View file

@ -1,7 +1,7 @@
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :select_foodcoop, :authenticate, :store_controller
before_filter :select_foodcoop, :authenticate, :store_controller, :items_per_page
after_filter :remove_controller
helper_method :current_user
@ -136,4 +136,12 @@ class ApplicationController < ActionController::Base
RoutingFilter::Foodcoop.active = false
end
end
def items_per_page
if (params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 100)
@per_page = params[:per_page].to_i
else
@per_page = 20
end
end
end