Rails 大家用什么查询插件? 默认的很多复杂查询都不好做

linjunhalida · August 08, 2012 · Last by heliang7 replied at August 09, 2012 · 2560 hits

现在我还是写 sql,比如: User.where("name = :id or id = :id", id: id)

但是觉得很不优雅,想用一下第三方的插件,比如这个:

http://erniemiller.org/projects/metawhere/

大家是用什么插件的?

squeel + meta_where + meta_search + ryanb-scope-builder 应该可以解决 90% 的案例

Ransack 号称是 The successor to MetaSearch,同一个作者。

Unknow user #4 August 09, 2012

一直在用 searchlogic

写 scope 就优雅了

#5 楼 @huacnlee + 1 scope 和 delegate 比较给力。

You need to Sign in before reply, if you don't have an account, please Sign up first.