sort characters alphabetically

This commit is contained in:
Andrew Brown 2013-01-01 02:18:30 -06:00
parent a96a73130c
commit c3934f5ca6

View File

@ -11,6 +11,8 @@ class CharactersController < ApplicationController
@characters = []
end
@characters = @characters.sort { |a, b| a.name.downcase <=> b.name.downcase }
respond_to do |format|
format.html # index.html.erb
format.json { render json: @characters }