Reputation: 29
I'm currently doing a dictionnay, glossary here http://beta.emangaka.com/definitions
I sort the definition alphabetically.
definitions_controller.rb :
def index
@definitions = Definition.all.order('title ASC')
@titre = "Définitions"
end
index.html.erb
<% @definitions.each do |definition| %>
...
The list is too long and I'm looking for group by letter too always based on the first letter of "title".
How to do ? Merci. Thank you.
Upvotes: 2
Views: 856