init kaminari
This commit is contained in:
parent
7bb795e379
commit
ac71223b6b
1
Gemfile
1
Gemfile
@ -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'
|
||||||
|
13
Gemfile.lock
13
Gemfile.lock
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -24,4 +24,5 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
<%= paginate @candidates %>
|
||||||
</main>
|
</main>
|
||||||
|
12
config/initializers/kaminari_config.rb
Normal file
12
config/initializers/kaminari_config.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user