Skip to content
Browse files

fix paginated_section helper when no pagination is shown

  • Loading branch information...
1 parent a9b8f07 commit 0b9df8eb107420897ee8e4dbad4c61ff1beed67b @mislav committed Jul 26, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/will_paginate/view_helpers/action_view.rb
View
10 lib/will_paginate/view_helpers/action_view.rb
@@ -61,8 +61,12 @@ def page_entries_info(collection = nil, options = {}) #:nodoc:
# apply. Don't use the <tt>:id</tt> option; otherwise you'll finish with two
# blocks of pagination links sharing the same ID (which is invalid HTML).
def paginated_section(*args, &block)
- pagination = will_paginate(*args).to_s
- pagination + capture(&block) + pagination
+ pagination = will_paginate(*args)
+ if pagination
+ pagination + capture(&block) + pagination
+ else
+ capture(&block)
+ end
end
protected
@@ -129,4 +133,4 @@ def get_request?
def parse_query_parameters(params)
Rack::Utils.parse_nested_query(params)
end
-end
+end

0 comments on commit 0b9df8e

Please sign in to comment.
Something went wrong with that request. Please try again.