Class: Crm::Reports::WebSitePerformanceController

Inherits:
CrmController
  • Object
show all
Defined in:
app/controllers/crm/reports/web_site_performance_controller.rb

Overview

Website-performance report: traffic/conversion metrics broken down by
branch and breakdown dimension.

Instance Method Summary collapse

Instance Method Details

#showvoid

This method returns an undefined value.

Runs the report command and renders the full page, or just the
mini_view partial when embedded in a Turbo Frame or requested via XHR.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/crm/reports/web_site_performance_controller.rb', line 12

def show
  params[:command] ||= {}
  params[:command][:branch] ||= []
  params[:command][:breakdown] ||= [1]
  @report_command = ::Report::WebSitePerformance::WebSitePerformanceCommand.new(params[:command])
  @result = @report_command.execute
  return render partial: 'mini_view', layout: false if request.headers['Turbo-Frame'].present?

  respond_to do |format|
    format.html do
      render partial: 'mini_view', layout: false if request.xhr?
    end
  end
end