need help to display top 5 recent blog links

23 views
Skip to first unread message

kore...@gmail.com

unread,
Apr 21, 2014, 10:15:17 AM4/21/14
to refine...@googlegroups.com
Hello
I am using RefineryCMS 2.1.0 and Blog version 2.1.0 ....
I would like to display top 5 recent blog links within my web page.
It will be helpful if you could suggest any pointers to address this requirement ...
 
Thank you in advance ...
 
Cheers,
Nikhil Choudhari
 

Philip Arndt

unread,
Apr 21, 2014, 11:38:28 AM4/21/14
to refine...@googlegroups.com
There are two scope methods on the Refinery::Blog::Post model that will find the records that you want:

    Refinery::Blog::Post.newest_first.recent(5)


kore...@gmail.com

unread,
Apr 26, 2014, 8:20:42 AM4/26/14
to refine...@googlegroups.com
Thank you for suggestion, it helps to find alternate code snippet - Refinery::Blog::Post.live.limit(5)
we could able to display 5 recent blogs using this code snippet and decorators.
Reply all
Reply to author
Forward
0 new messages