['Test','Bla','Test2'].group_by{|str| str[0]}
=> {"T"=>["Test", "Test2"], "B"=>["Bla"]}
@cities_grouped = city.all.group_by{|r| r.name[0]}
<% @cities_grouped.each do |letter, group| %>
<div>
<% @group.each do |city| %>
<%= city.name %>
<% end %>
</div>
<% end %>