mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 09:20:38 -07:00
move methods from analyze helper to background presenter
This commit is contained in:
parent
88339c729f
commit
c568e8bc06
10 changed files with 115 additions and 77 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class AnalyzeController < SqmApplicationController
|
||||
before_action :assign_categories, :assign_subcategories, :assign_measures, :assign_academic_years,
|
||||
:response_rate_timestamp, :races, :selected_races, :graph, :graphs, only: [:index]
|
||||
:response_rate_timestamp, :races, :selected_races, :graph, :graphs, :background, only: [:index]
|
||||
def index; end
|
||||
|
||||
private
|
||||
|
|
@ -66,10 +66,18 @@ class AnalyzeController < SqmApplicationController
|
|||
end
|
||||
|
||||
def graph
|
||||
@graph ||= params[:graph] || 'students-and-teachers'
|
||||
graphs.each do |graph|
|
||||
@graph = graph if graph.value == params[:graph]
|
||||
end
|
||||
|
||||
@graph ||= graphs.first
|
||||
end
|
||||
|
||||
def graphs
|
||||
@graphs ||= [AnalysisGraph::StudentsAndTeachers.new, AnalysisGraph::StudentsByGroup.new]
|
||||
end
|
||||
|
||||
def background
|
||||
@background ||= BackgroundPresenter.new(num_of_columns: graph.columns.count)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue