Permalink
Browse files

Removed block from #li

We are not defering anything so misewell just pass it as an argument
  • Loading branch information...
1 parent a273a68 commit d47c2a4c03c96b7812de1d650693b893f61c32fe @tj committed Oct 8, 2009
Showing with 9 additions and 10 deletions.
  1. +9 −10 lib/dm-pagination/pager.rb
@@ -89,7 +89,7 @@ def link_to page, contents = nil
def more position
return '' if position == :before && (current_page <= 1 || first <= 1)
return '' if position == :after && (current_page >= total_pages || last >= total_pages)
- li('more') { Pagination.defaults[:more_text] }
+ li 'more', Pagination.defaults[:more_text]
end
##
@@ -99,36 +99,36 @@ def intermediate_links
(first..last).map do |page|
classes = current_page == page ? ['active'] : []
classes << "page-#{page}"
- li(classes.join(' ')) { link_to(page) }
+ li classes.join(' '), link_to(page)
end
end
##
# Previous link.
def previous_link
- previous_page ? li('previous jump') { link_to(previous_page, Pagination.defaults[:previous_text]) } : ''
+ previous_page ? li('previous jump', link_to(previous_page, Pagination.defaults[:previous_text])) : ''
end
##
# Next link.
def next_link
- next_page ? li('next jump') { link_to(next_page, Pagination.defaults[:next_text]) } : ''
+ next_page ? li('next jump', link_to(next_page, Pagination.defaults[:next_text])) : ''
end
##
# Last link.
def last_link
- next_page ? li('last jump') { link_to(total_pages, Pagination.defaults[:last_text]) } : ''
+ next_page ? li('last jump', link_to(total_pages, Pagination.defaults[:last_text])) : ''
end
##
# First link.
def first_link
- previous_page ? li('first jump') { link_to(1, Pagination.defaults[:first_text]) } : ''
+ previous_page ? li('first jump', link_to(1, Pagination.defaults[:first_text])) : ''
end
##
@@ -158,11 +158,10 @@ def last
end
##
- # Renders a <li> with the given class
- # and content from the given block.
+ # Renders a <li> with the given _css_class_ and _contents_.
- def li css_class = nil, &block
- "<li#{%( class="#{css_class}") if css_class}>#{yield}</li>\n"
+ def li css_class = nil, contents = nil
+ "<li#{%( class="#{css_class}") if css_class}>#{contents}</li>\n"
end
##

0 comments on commit d47c2a4

Please sign in to comment.