Adjust paginator window argument

This commit is contained in:
yafeilee 2016-04-21 18:12:30 +08:00
parent 3615504b76
commit 02f09f1d38
2 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ class Admin::PostsController < ApplicationController
end end
def index def index
@posts = Post.order(created_at: :desc).page(params[:page]).per(1) @posts = Post.order(created_at: :desc).page(params[:page])
end end
def create def create

View File

@ -1,10 +1,10 @@
Kaminari.configure do |config| Kaminari.configure do |config|
config.default_per_page = 10 config.default_per_page = 10
# config.max_per_page = nil # config.max_per_page = nil
# config.window = 4 config.window = 2
# config.outer_window = 0 # config.outer_window = 0
# config.left = 0 config.left = 0
# config.right = 0 config.right = 0
# config.page_method_name = :page # config.page_method_name = :page
# config.param_name = :page # config.param_name = :page
end end