次のように、Ruby on Rails を使用して mySQL データベースからデータを取得しています。
def all_specs
Specialization.order("title ASC").all;
end
さて、ビューファイルでこのデータを次のように並べ替えたいと思います。
<div class="nav-column">
<h3>A</h3>
<ul class="submenu">
<li><a href="#">All data that has title that starts with A</a></li>
</ul>
</div>
<div class="nav-column">
<h3>A</h3>
<ul class="submenu">
<li><a href="#">All data that has title that starts with B</a></li>
</ul>
</div>
and so on from A-Z
どうすればそれを達成できますか?