From 873de8958ba3753340691056f1e8bba9af42f3ea Mon Sep 17 00:00:00 2001 From: manson Date: Fri, 4 Jul 2014 16:10:42 +0800 Subject: [PATCH] Add pagination --- app/controllers/admin/page_contents_controller.rb | 2 +- app/views/admin/page_contents/index.html.erb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/page_contents_controller.rb b/app/controllers/admin/page_contents_controller.rb index 3da817c..5278afd 100644 --- a/app/controllers/admin/page_contents_controller.rb +++ b/app/controllers/admin/page_contents_controller.rb @@ -1,6 +1,6 @@ class Admin::PageContentsController < OrbitAdminController def index - @pages = Page.where(:module=>"page_content") + @pages = Page.where(:module=>"page_content").page(params[:page]).per(10) @table_fields = ["Name","Version","Updated At","Last Modified By"] end diff --git a/app/views/admin/page_contents/index.html.erb b/app/views/admin/page_contents/index.html.erb index 6b7cc0d..35528b0 100644 --- a/app/views/admin/page_contents/index.html.erb +++ b/app/views/admin/page_contents/index.html.erb @@ -24,4 +24,9 @@ <% end %> +<%= + content_tag :div, class: "bottomnav clearfix" do + content_tag :div, paginate(@pages), class: "pagination pagination-centered" + end +%>