Rails :order, can I order by 2 things at the same time, one before the other?
so I want to do something like this:
, :order => "(products.name = 'Some Product' or products.name) desc", :order=>'distance'
has anyon开发者_JAVA百科e done this before? I realize that I cant do it the way I have written, but hope it explains the order I want the orders to happen.
Yes, you can.
:order => "column1 ASC, column2 DESC"
精彩评论