From 941ebdb2e55329f9d43bb81e8c2064b29a6d0d30 Mon Sep 17 00:00:00 2001 From: Tom Reis Date: Mon, 3 Aug 2020 11:41:41 -0600 Subject: [PATCH] Order schools list alphabetically --- app/controllers/ajax/schools_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/ajax/schools_controller.rb b/app/controllers/ajax/schools_controller.rb index c42b8b26..c1942b15 100644 --- a/app/controllers/ajax/schools_controller.rb +++ b/app/controllers/ajax/schools_controller.rb @@ -5,7 +5,10 @@ class SchoolsController < ApplicationController skip_after_action :verify_policy_scoped, only: :index def index - @schools = current_organization.schools.where(school_type: params[:school_type]).enabled + @schools = current_organization.schools + .where(school_type: params[:school_type]) + .enabled + .order(School.arel_table['school_name'].lower.asc) render json: @schools end