Sorting a db result set


#1

hola!

#controller code which gets all the db records:
def list2
@teams = Team.find_all
end

#rhtml code
@teams.each do |team|

the question is how do i do a “sort by” “columnX”?

cheers


#2

mizage wrote:

hola!

#controller code which gets all the db records:
def list2
@teams = Team.find_all
end

@teams = Team.find :all, :order => “columnx”

-Brian


#3

def list2
@teams = Team.find :all, :order => ‘columnX’
end

Kent.