working on navigation

This commit is contained in:
Jared Cosulich 2017-10-18 11:54:52 -04:00
parent 36329235d0
commit b0331e2259
5 changed files with 13 additions and 8 deletions

View file

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

View file

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

View file

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

View file

@ -8,16 +8,11 @@
- if true || user_signed_in?
.row.mt-3
.col-6
.col-12
%h4 Districts
- @districts.each do |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

View file

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