I am building a list that will be sorted by the alphabet and am looking for a solution to grab the database result and sort it alphabetically.
Any help is greatly appreciated!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hmm, if you have a list that isn’t too massive you might just do it naively like:
(This assumes you have a model
Companywhich has anameattribute)And now you can, in your view, do something such as:
Update: If you want to extend the logic on what the ‘letter’ is, you would probably move the logic into the model, eg: