Class: Railscope::DashboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/railscope/dashboard_controller.rb

Constant Summary collapse

PER_PAGE =
25

Instance Method Summary collapse

Instance Method Details

#index ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/controllers/railscope/dashboard_controller.rb', line 7

def index
  @entries = filtered_entries.recent.limit(PER_PAGE).offset(offset)
  @total_count = filtered_entries.count
  @entry_types = Entry.distinct.pluck(:entry_type).sort
  @current_type = params[:type]
  @current_page = current_page
  @total_pages = (@total_count.to_f / PER_PAGE).ceil
end