<div class="pagination">
	<%= link_to 'Newer', send("#{resource.class.name.demodulize.downcase}_path", resource.newer), class: 'previous_page', rel: 'prev' if resource.newer %>
	<%= link_to 'Older', send("#{resource.class.name.demodulize.downcase}_path", resource.older), class: 'next_page', rel: 'next' if resource.older %>
</div>
<%- resource_route = "#{resource.class.name.demodulize.downcase}_path" -%>

<div class="pagination">
	<%- if resource.newer -%>
		<%= link_to 'Newer', send(resource_route, resource.newer), class: 'previous_page', rel: 'prev', title: "Navigate to “#{resource.newer.title}”" %>
	<%- end -%>
	<%- if resource.older -%>
		<%= link_to 'Older', send(resource_route, resource.older), class: 'next_page', rel: 'next', title: "Navigate to “#{resource.older.title}”" %>
	<%- end -%>
</div>
Refactor single resource pagination partial.
Refactor single resource pagination partial.
