0
我正在尝试制作一个供稿页面,用户可以在其中查看热门帖子和他们关注的帖子。这是我试过的(但失败):如何获得超过特定数量的投票的帖子? - Rails
@popularPosts = Post.where(cached_votes_score > '2')
返回一个错误。
undefined local variable or method `cached_votes_score' for #<PagesController:0x007fa2ae08f630> Did you mean? cache_store
对此有何看法?
我觉得也只是Post.where('cached_votes_score> 2') – Hopscott
你是绝对正确的,特别是如果2没有改变,因为它似乎在这个例子中。我会更新我的回应以帮助未来的读者。 – Leito
而从0 - > 9,它是'where('-1