Class: AhoyCaptain::TopPagesController

Inherits:
ApplicationController show all
Includes:
Limitable
Defined in:
app/controllers/ahoy_captain/top_pages_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#period

Methods included from Rangeable

#period

Methods included from CompareMode

#compare_mode?, #comparison_mode, included

Instance Method Details

#indexObject



11
12
13
14
15
16
17
18
# File 'app/controllers/ahoy_captain/top_pages_controller.rb', line 11

def index
  results = cached(:top_pages) do
    TopPageQuery.call(params)
               .limit(limit)
  end

  @pages = paginate(results).map { |page| TopPageDecorator.new(page, self) }
end