Class: ConsoleAgent::SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ConsoleAgent::SessionsController
- Defined in:
- app/controllers/console_agent/sessions_controller.rb
Constant Summary collapse
- PER_PAGE =
50
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
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 |
#show ⇒ Object
12 13 14 |
# File 'app/controllers/console_agent/sessions_controller.rb', line 12 def show @session = Session.find(params[:id]) end |