Class: AhoyCaptain::Locations::CitiesController

Inherits:
ApplicationController show all
Includes:
AhoyCaptain::Limitable
Defined in:
app/controllers/ahoy_captain/locations/cities_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



12
13
14
15
16
17
18
19
# File 'app/controllers/ahoy_captain/locations/cities_controller.rb', line 12

def index
  results = cached(:cities) do
    CityQuery.call(params)
             .limit(limit)
  end

  @cities = paginate(results).map { |city| CityDecorator.new(city, self) }
end