Class: ConsoleAgent::SessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/console_agent/sessions_controller.rb

Constant Summary collapse

PER_PAGE =
50

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
9
10
# File 'app/controllers/console_agent/sessions_controller.rb', line 5

def index
  @page = [params[:page].to_i, 1].max
  @total = Session.count
  @total_pages = (@total / PER_PAGE.to_f).ceil
  @sessions = Session.recent.offset((@page - 1) * PER_PAGE).limit(PER_PAGE)
end

#showObject



12
13
14
# File 'app/controllers/console_agent/sessions_controller.rb', line 12

def show
  @session = Session.find(params[:id])
end