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!
On Jun 19, 7:43 am, shaselai [email protected] 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.