1
0
Fork 0

Paginate action Settings::SessionsController#index

This commit is contained in:
Alex Kotov 2019-09-03 20:32:22 +05:00
parent 451370df8a
commit 48fa4eb81e
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 3 additions and 1 deletions

View file

@ -7,6 +7,7 @@ class Settings::SessionsController < ApplicationController
def index
authorize [:settings, Session]
@sessions = current_account.sessions.order(logged_at: :desc).limit(10)
@sessions = current_account.sessions.order(logged_at: :desc)
.page(params[:page])
end
end

View file

@ -6,6 +6,7 @@
<div class="col-md-9">
<%= render partial: 'table', locals: { sessions: @sessions } %>
<%= paginate @sessions %>
</div>
</div>
</div>