Hello,
I have a hash map that gets pumped full of info. The key is a
username... I'm using a @myhashmap.each do |key, item| to display the
hash map in my rhtml, but I need it to be alphabetized... Is there a
built-in way to do this?
hashes in ruby don't have a guaranteed order (at least not in 1.8. Ruby 1.9 is different). Your best bet is probably to sort the keys and iterate on that.
Hello,
I have a hash map that gets pumped full of info. The key is a
username... I'm using a @myhashmap.each do |key, item| to display the
hash map in my rhtml, but I need it to be alphabetized... Is there a
built-in way to do this?