ruby - Rails Display post according to timestamp -
i noob in rails following rails official documentation creating blog, after creating blog post , comment controller want add way display post according time-stamp i.e. post created last or had commented on post displayed on top of list. please suggest way or gem achieve this.
use order
of activerecord. assuming blog model blog
blog.order("updated_at desc")
check tutorial
you can create scope
Comments
Post a Comment