Rails paginate 里面的 condtions 的数组,如何转换成 sql 语句呢

xybeta · June 13, 2012 · Last by xybeta replied at June 13, 2012 · 2225 hits

paginate 里面的 condtions 的数组,如何转换成 sql 语句呢? 例如 paginate(:conditions => ['id=? and name=?', "1", "test"]) conditions 数组能直接转换成 string 类型的 sql 条件语句吗?

这么说来楼主在用 rails2, paginate 有 paginate_by_sql

但是 在 paginate 里面有效的 condtions,用到 paginate_by_sql 里面没有效果了。

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