You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sqm-dashboards/app/controllers/dashboard_controller.rb

35 lines
758 B

class DashboardController < ApplicationController
def index
authenticate(district.name.downcase, "#{district.name.downcase}!")
@construct_graph_row_presenters = Construct.where(construct_id: '1A-i').map do | construct |
ConstructGraphRowPresenter.new(
construct: construct,
score: SurveyResponseAggregator.score(school: school, academic_year: academic_year, construct: construct)
)
end
end
private
def school
@school ||= School.find_by_slug school_slug
end
def district
@district ||= District.find_by_slug district_slug
end
def district_slug
params[:district_id]
end
def school_slug
params[:school_id]
end
def academic_year
@academic_year ||= params[:year]
end
end