Sometime you want to add Next or Previous links to your blog posts or whatever model. Its really easy, just add a couple of instance methods to your model
<%= link_to "Next Post", @post.next %>
<%= link_to "Prev Post", @post.prev %>
Sometime you want to add Next or Previous links to your blog posts or whatever model. Its really easy, just add a couple of instance methods to your model
<%= link_to "Next Post", @post.next %>
<%= link_to "Prev Post", @post.prev %>
Article Topic:Software Development - Ruby / Rails
Date:March 18, 2015
Want me to help develop your next Ruby-on-Rails project or application?
Contact Me