Skip to content

Commit

Permalink
fix paginated_section helper when no pagination is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 26, 2011
1 parent a9b8f07 commit 0b9df8e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/will_paginate/view_helpers/action_view.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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.