diff --git a/app/controllers/info_controller.rb b/app/controllers/info_controller.rb index a1c9892..4018c38 100644 --- a/app/controllers/info_controller.rb +++ b/app/controllers/info_controller.rb @@ -4,7 +4,7 @@ class InfoController < ApplicationController before_filter :auth, except: [:index, :show] def index - @info = Info.all.sort_by{|i| i.title} + @info = Info.order(:title).page(params[:page]) end def show diff --git a/app/views/info/index.html.erb b/app/views/info/index.html.erb index e1738d2..7660f1d 100644 --- a/app/views/info/index.html.erb +++ b/app/views/info/index.html.erb @@ -8,4 +8,5 @@ <% @info.each do |info| %> <%= link_to info.title, info %> <% end %> + <%= paginate @info %> \ No newline at end of file