[eluser]Andy UK[/eluser]
Good evening all,
I currently have a dropdown select with cities in alphabetical order. Some are from one country and some are from another. I would now like to separate these cities into categories, the category being the country.
With a simple activerecord join I can add the country name to the result set for each city, but I don't know if there's a way to use this to categorise the results. Is this possible or will I have to first loop through the countries and query the database for each country to get the active cities and then store in a multiple array by country? I'm guessing the second, but if anyone knows an easier way, I'm interested in hearing it!
Thanks