Class: AhoyCaptain::Filters::UtmsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- ApplicationController
- BaseController
- AhoyCaptain::Filters::UtmsController
- Defined in:
- app/controllers/ahoy_captain/filters/utms_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
4 5 6 7 |
# File 'app/controllers/ahoy_captain/filters/utms_controller.rb', line 4 def index query = visit_query.select("#{params[:type]}", "count(#{params[:type]}) as total").group(params[:type]).order(Arel.sql "count(#{params[:type]}) desc").pluck(params[:type]).map { |city| serialize(city) } render json: query end |