Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactor #{previous,next,first,last}_link

Now that we use #join in #to_html we can avoid returning an empty string
  • Loading branch information...
commit c8182774f9c98ceddd29c945d739149534e898b6 1 parent d47c2a4
@tj authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/dm-pagination/pager.rb
View
8 lib/dm-pagination/pager.rb
@@ -107,28 +107,28 @@ def intermediate_links
# Previous link.
def previous_link
- previous_page ? li('previous jump', link_to(previous_page, Pagination.defaults[:previous_text])) : ''
+ li 'previous jump', link_to(previous_page, Pagination.defaults[:previous_text]) if previous_page
end
##
# Next link.
def next_link
- next_page ? li('next jump', link_to(next_page, Pagination.defaults[:next_text])) : ''
+ li 'next jump', link_to(next_page, Pagination.defaults[:next_text]) if next_page
end
##
# Last link.
def last_link
- next_page ? li('last jump', link_to(total_pages, Pagination.defaults[:last_text])) : ''
+ li 'last jump', link_to(total_pages, Pagination.defaults[:last_text]) if next_page
end
##
# First link.
def first_link
- previous_page ? li('first jump', link_to(1, Pagination.defaults[:first_text])) : ''
+ li 'first jump', link_to(1, Pagination.defaults[:first_text]) if previous_page
end
##
Please sign in to comment.
Something went wrong with that request. Please try again.