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 'jbuilder', '~> 2.6'
gem 'jquery-rails' gem 'jquery-rails'
gem 'json', '~> 2.0.2' gem 'json', '~> 2.0.2'
gem 'kaminari'
gem 'mailjet', '~> 1.3.8' gem 'mailjet', '~> 1.3.8'
gem 'puma', '~> 3.0' gem 'puma', '~> 3.0'
gem 'pundit' gem 'pundit'

View File

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

View File

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

View File

@ -24,4 +24,5 @@
</tr> </tr>
<% end %> <% end %>
</table> </table>
<%= paginate @candidates %>
</main> </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