应用列表分页功能

This commit is contained in:
wanglinchun 2014-04-29 14:40:39 +08:00
parent db2d2e9b24
commit dbe4c26322
1 changed files with 2 additions and 1 deletions

View File

@ -7,8 +7,9 @@ class SoftapplicationsController < ApplicationController
# GET /softapplications.json
def index
@softapplications = Softapplication.all
#new added fenyefunction
@limit = 5
#new added
@softapplication_count = @softapplications.count
@softapplication_pages = Paginator.new @softapplication_count, @limit, params['page']
@offset ||= @softapplication_pages.offset