Class: AhoyCaptain::CampaignsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- AhoyCaptain::CampaignsController
- Includes:
- Limitable
- Defined in:
- app/controllers/ahoy_captain/campaigns_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Methods included from Rangeable
Methods included from CompareMode
#compare_mode?, #comparison_mode, included
Instance Method Details
#index ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/controllers/ahoy_captain/campaigns_controller.rb', line 11 def index results = cached(:campaigns, params[:campaigns_type]) do CampaignQuery.call(params).limit(limit) end @campaigns = paginate(results).map { |campaign| CampaignDecorator.new(campaign, self) } @campaign_type = params[:campaigns_type]&.titleize&.gsub("Utm", "UTM") end |