/ Published in: Rails
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#article_drop.rb ## this goes in app/drops/article_drop.rb def next? !@source.next.blank? end def previous? !@source.previous.blank? end #previous link {% if article.previous? %} {{ article | previous_article | link_to_article }} {% else %} <a href="/">home</a> {% endif %} #next link {% if article.next? %} {{ article | next_article | link_to_article }} {% else %} <a href="/">home</a> {% endif %}
URL: http://tesoriere.com/2009/4/mephisto-next-article-link-and-previous-article-link