From 66a7827eb25e8c93eb5c035e73234dfc3d60d24c Mon Sep 17 00:00:00 2001 From: linchun Date: Fri, 18 Mar 2016 12:55:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E9=A1=B5=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=AD=A6?= =?UTF-8?q?=E6=A0=A1=E5=88=97=E8=A1=A8=E8=B0=83=E6=95=B4=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 9 +++++++-- app/views/admin/organization.html.erb | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index e9a63b25e..0def99733 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -392,6 +392,11 @@ class AdminController < ApplicationController def organization @organizations = Organization.find_by_sql("SELECT * FROM organizations ORDER BY created_at DESC") #@organizations = Organization.all.order("created_at desc") + @organization_count = @organizations.count + @organization_pages = Paginator.new @organization_count, 30, params['page'] || 1 + @organizations = paginateHelper @organizations,30 + + @page = (params['page'] || 1).to_i - 1 respond_to do |format| format.html end @@ -403,8 +408,8 @@ class AdminController < ApplicationController @schools = School.find_by_sql("SELECT * FROM schools ORDER BY created_at DESC") @school_count = @schools.count - @school_pages = Paginator.new @school_count, 50, params['page'] || 1 - @schools = paginateHelper @schools,50 + @school_pages = Paginator.new @school_count, 30, params['page'] || 1 + @schools = paginateHelper @schools,30 @page = (params['page'] || 1).to_i - 1 respond_to do |format| diff --git a/app/views/admin/organization.html.erb b/app/views/admin/organization.html.erb index fe5fdb391..02b897f80 100644 --- a/app/views/admin/organization.html.erb +++ b/app/views/admin/organization.html.erb @@ -40,4 +40,8 @@ + +