0
我使用所谓的acts_as_follower
(https://github.com/tcocca/acts_as_follower)宝石为什么不这样做?
然后我在用户表称为last_active_at
列(用户模式)
在这里,我想获取所有后跟CURRENT_USER谁的用户。
它必须订购last_active_at
我试过这个,但它没有按顺序。 我该如何解决?
控制器
@users = current_user.following_users(order: 'users.last_active_at DESC')
@users_followed = Kaminari.paginate_array(@users)
谢谢!这就是完美的答案 – MKK
请等待8分钟,以便我将您的答案作为最佳答案 – MKK