mercredi 24 juin 2015

How to put specific options on top of dropdown list in rails

I need to show some specific options in a dropdown list on top and should sort other options in alpha order. For example if the list is,

["CANADA", "PORTUGAL", "AUSTRALIA", "USA", "BRAZIL"]

I need to show the dropdown list as (usa and portugal as per requirements on top of the list and others in alpha order.)

["USA", "PORTUGAL", "AUSTRALIA", "BRAZIL", "CANADA"]

Aucun commentaire:

Enregistrer un commentaire