show accurate year

This commit is contained in:
Jared Cosulich 2018-07-21 11:42:16 -04:00
parent 9d81c39f54
commit 3d238df1c7
2 changed files with 7 additions and 2 deletions

View file

@ -13,7 +13,8 @@ class CategoriesController < ApplicationController
def show
district = @school.district
authenticate(district.name.downcase, "#{district.name.downcase}!")
@school_category = SchoolCategory.for(@school, @category).first
@year = (params[:year] || "2017").to_i
@school_category = SchoolCategory.for(@school, @category).in(@year).first
@child_school_categories = SchoolCategory.for_parent_category(@school, @category).valid
@questions = @category.questions
end

View file

@ -3,7 +3,11 @@
=# link_to(image_tag(@district.logo), @district) if @district.present?
%h2= link_to @school.name, @school
= simple_format(@school.description)
%p Data from 2016-2017 school year.
- if @year.present?
%p
Data from
= "#{@year - 1}-#{@year}"
school year.
- if @school.district.present?
%p
%strong District: