mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
linking between years
This commit is contained in:
parent
3d238df1c7
commit
5cecfc8374
4 changed files with 15 additions and 1 deletions
|
|
@ -13,7 +13,9 @@ class CategoriesController < ApplicationController
|
|||
def show
|
||||
district = @school.district
|
||||
authenticate(district.name.downcase, "#{district.name.downcase}!")
|
||||
@year = (params[:year] || "2017").to_i
|
||||
school_categories = SchoolCategory.for(@school, @category)
|
||||
@years = school_categories.map(&:year)
|
||||
@year = (params[:year] || @years.first).to_i
|
||||
@school_category = SchoolCategory.for(@school, @category).in(@year).first
|
||||
@child_school_categories = SchoolCategory.for_parent_category(@school, @category).valid
|
||||
@questions = @category.questions
|
||||
|
|
@ -82,5 +84,6 @@ class CategoriesController < ApplicationController
|
|||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def category_params
|
||||
params.require(:category).permit(:name, :blurb, :description, :external_id, :parent_category_id)
|
||||
raise params.inspect
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
Data from
|
||||
= "#{@year - 1}-#{@year}"
|
||||
school year.
|
||||
Show:
|
||||
- @years.each do |year|
|
||||
= link_to(year, school_category_path(@school_category.school, @school_category.category, year: year))
|
||||
- if @school.district.present?
|
||||
%p
|
||||
%strong District:
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ ActiveRecord::Schema.define(version: 20180711164051) do
|
|||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
enable_extension "pg_stat_statements"
|
||||
|
||||
create_table "attempts", force: :cascade do |t|
|
||||
t.integer "recipient_id"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,14 @@
|
|||
# run console: SchoolCategory.update_all(year: '2017')
|
||||
# rake data:load_questions_csv
|
||||
# rake data:load_responses
|
||||
# sudo heroku run:detached rake data:load_responses -a mciea-beta --size performance-l
|
||||
|
||||
Access Key ID:
|
||||
AKIAIU4VEKWV23W2WKSQ
|
||||
Secret Access Key:
|
||||
4BPB9kpNTUCj/pwWXA/u59zO5Jj4/y0gNWm3MjvN
|
||||
|
||||
sudo heroku pg:backups:restore 'https://s3.amazonaws.com/irrationaldesign/latest.dump' DATABASE_URL -a mciea-beta
|
||||
|
||||
# Add:
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue