Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的索引操作中,我有
@messages = Message.scoped.page(params[:page]).per(20)
我希望这些消息像现在一样按 id 排序,但相反。如何在控制器中实现这一点?
@messages = Message.order('id DESC').page(params[:page]).per(20)