compserv / hkn-rails

The website for HKN Mu Chapter
https://hkn.eecs.berkeley.edu
Other
5 stars 10 forks source link

Sort Bridge photo officer dropdown by first name + last name #286

Closed ochan1 closed 2 years ago

ochan1 commented 2 years ago

Starting inspiration: https://stackoverflow.com/questions/6596529/ruby-on-rails-how-to-sort-a-collection-select

During testing on that inspiration, it didn't work because the "@ officer" variable (without space) is an array

But since that line looks to be code and the above does work on Models, the array version of "order" is "sort"

https://stackoverflow.com/questions/5739158/rails-ruby-how-to-sort-an-array

Tested by running the line on a Rails console (in sandbox) and it sorts the first name Did not test on a front end because it was too annoying to import database for local, but if all checks out this is a simple fix to work