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