init kaminari

This commit is contained in:
Mark Moser 2017-02-24 14:27:38 -06:00
parent 7bb795e379
commit ac71223b6b
5 changed files with 28 additions and 0 deletions

View File

@ -9,6 +9,7 @@ gem 'rails', '~> 5.0', '>= 5.0.1'
gem 'jbuilder', '~> 2.6'
gem 'jquery-rails'
gem 'json', '~> 2.0.2'
gem 'kaminari'
gem 'mailjet', '~> 1.3.8'
gem 'puma', '~> 3.0'
gem 'pundit'

View File

@ -124,6 +124,18 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.0.3)
kaminari (1.0.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
kaminari-activerecord (= 1.0.1)
kaminari-core (= 1.0.1)
kaminari-actionview (1.0.1)
actionview
kaminari-core (= 1.0.1)
kaminari-activerecord (1.0.1)
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
@ -314,6 +326,7 @@ DEPENDENCIES
jbuilder (~> 2.6)
jquery-rails
json (~> 2.0.2)
kaminari
listen
mailjet (~> 1.3.8)
minitest-reporters

View File

@ -14,6 +14,7 @@ module Admin
@candidates = Candidate.where(completed: true)
.includes(:recruiter)
.order("#{sort_column} #{sort_direction}")
.page(params[:page])
end
def view

View File

@ -24,4 +24,5 @@
</tr>
<% end %>
</table>
<%= paginate @candidates %>
</main>

View File

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