Class: ActiveAnalytics::ReferrersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ActiveAnalytics::ReferrersController
- Defined in:
- app/controllers/active_analytics/referrers_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/active_analytics/referrers_controller.rb', line 7 def index scope = ViewsPerDay.where(site: params[:site]).between_dates(params[:from], params[:to]) @referrers = scope.top(100).group_by_referrer_site @histogram = ViewsPerDay::Histogram.new(scope.order_by_date.group_by_date, params[:from], params[:to]) end |
#show ⇒ Object
13 14 15 16 17 18 |
# File 'app/controllers/active_analytics/referrers_controller.rb', line 13 def show scope = ViewsPerDay.where(site: params[:site], referrer_host: params[:referrer]).between_dates(params[:from], params[:to]) @histogram = ViewsPerDay::Histogram.new(scope.order_by_date.group_by_date, params[:from], params[:to]) @previous_pages = scope.top(100).group_by_referrer_page @next_pages = scope.top(100).group_by_page end |