paginate info
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -8,4 +8,5 @@
|
||||
<% @info.each do |info| %>
|
||||
<%= link_to info.title, info %>
|
||||
<% end %>
|
||||
<%= paginate @info %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user