From 02f09f1d38b6b7f6c9b8d90f9fd294817f6e6546 Mon Sep 17 00:00:00 2001 From: yafeilee Date: Thu, 21 Apr 2016 18:12:30 +0800 Subject: [PATCH] Adjust paginator window argument --- app/controllers/admin/posts_controller.rb | 2 +- config/initializers/kaminari_config.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/posts_controller.rb b/app/controllers/admin/posts_controller.rb index bf7c8a0..d583c48 100644 --- a/app/controllers/admin/posts_controller.rb +++ b/app/controllers/admin/posts_controller.rb @@ -22,7 +22,7 @@ class Admin::PostsController < ApplicationController end def index - @posts = Post.order(created_at: :desc).page(params[:page]).per(1) + @posts = Post.order(created_at: :desc).page(params[:page]) end def create diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb index ed1fe79..0f238a6 100644 --- a/config/initializers/kaminari_config.rb +++ b/config/initializers/kaminari_config.rb @@ -1,10 +1,10 @@ Kaminari.configure do |config| config.default_per_page = 10 # config.max_per_page = nil - # config.window = 4 + config.window = 2 # config.outer_window = 0 - # config.left = 0 - # config.right = 0 + config.left = 0 + config.right = 0 # config.page_method_name = :page # config.param_name = :page end