From 57d196df8b77abfc0e074948f2502eb8d4a812ff Mon Sep 17 00:00:00 2001 From: Jake Benilov Date: Tue, 8 Oct 2024 16:50:08 +0100 Subject: [PATCH] Sort cohort list by first name, last name --- app/controllers/cohorts_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/cohorts_controller.rb b/app/controllers/cohorts_controller.rb index c4c3eab80..f5e8c1c04 100644 --- a/app/controllers/cohorts_controller.rb +++ b/app/controllers/cohorts_controller.rb @@ -26,7 +26,10 @@ def index def show @cohort = policy_scope(Cohort).find(params[:id]) - @patients = @cohort.patients.recorded + @patients = + @cohort.patients.recorded.sort_by do |patient| + [patient.first_name, patient.last_name] + end end private