On Jun 19, 7:43 am, shaselai
<shase...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:> If I have a database table called Books and I want to sort it by date
> or title, what is the correct command to do so? It probably starts
> with Book.find(....)? thanks!
Book.find(:all, :order => "title ASC")
Book.find(:all, :order => "date DESC")
just use some SQL order for this param.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---