开发者

Rails :order, can I order by 2 things at the same time, one before the other?

开发者 https://www.devze.com 2023-01-08 19:22 出处:网络
so I want to do something like this: , :order => \"(products.name = \'Some Product\' or products.name) desc\", :order=>\'distance\'

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"
0

精彩评论

暂无评论...
验证码 换一张
取 消