The simplest thing for you would be to sort your queryset and place listdividers (as you would do with jQuery Mobile) in your ERB file whenever the next element starts with a letter that is different from the one of the previous element (this could be achieved through a for-each loop).
I am assuming that you are using the Contacts API from Rhodes (Rhomobile). In that case there actually is an example here where they sort the contacts according to display_name
. It should however be noticed that the display_name
property only is available on the Android platform. You may therefore want to substitute it with the first_name
or last_name
properties that are supported on all platforms.
You can find another reference that explains sorting in Ruby here.