working on navigation

pull/1/head
Jared Cosulich 8 years ago
parent 36329235d0
commit b0331e2259

@ -10,7 +10,7 @@ class DistrictsController < ApplicationController
# GET /districts/1 # GET /districts/1
# GET /districts/1.json # GET /districts/1.json
def show def show
@schools = @district.schools @schools = @district.schools.alphabetic
end end
# GET /districts/new # GET /districts/new

@ -7,6 +7,8 @@ class School < ApplicationRecord
validates :name, presence: true validates :name, presence: true
scope :alphabetic, -> { order(name: :asc) }
include FriendlyId include FriendlyId
friendly_id :name, :use => [:slugged] friendly_id :name, :use => [:slugged]

@ -10,9 +10,17 @@
%h4 %h4
Schools in Schools in
= @district.name = @district.name
%br
- @district.schools.each do |school| - @district.schools.each do |school|
%p= link_to school.name, school %p= link_to school.name, school
%br
%br
%br
%br
= link_to "View All Districts", root_path
- else - else
.text-center.my-3.py-3 .text-center.my-3.py-3
%h3.my-3.py-3 %h3.my-3.py-3

@ -8,16 +8,11 @@
- if true || user_signed_in? - if true || user_signed_in?
.row.mt-3 .row.mt-3
.col-6 .col-12
%h4 Districts %h4 Districts
- @districts.each do |district| - @districts.each do |district|
%p= link_to district.name, district %p= link_to district.name, district
.col-6
%h4 Schools
-# current_user.schools.each do |school|
- School.all.each do |school|
%p= link_to school.name, school
- else - else

@ -145,7 +145,7 @@ namespace :data do
bad_answers = {} bad_answers = {}
year = '2017' year = '2017'
timeToRun = 100 * 60 * 60 timeToRun = 10 * 60
startIndex = 0 startIndex = 0
stopIndex = 100000 stopIndex = 100000
startTime = Time.new startTime = Time.new

Loading…
Cancel
Save