From f2a8a597bed50c66f7d1fe187e75fc44d1d28973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 4 Dec 2008 00:23:22 +0100 Subject: [PATCH] change concat calls in #paginated_section because of Rails 2.2 deprecation. this is a cherry-pick of 787555f477e7bd71f83b651e8611a7a53026c2c5 --- lib/will_paginate/view_helpers.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/will_paginate/view_helpers.rb b/lib/will_paginate/view_helpers.rb index 9737710ab..9233f3406 100644 --- a/lib/will_paginate/view_helpers.rb +++ b/lib/will_paginate/view_helpers.rb @@ -141,8 +141,15 @@ def will_paginate(collection = nil, options = {}) # blocks of pagination links sharing the same ID (which is invalid HTML). def paginated_section(*args, &block) pagination = will_paginate(*args).to_s - content = pagination + capture(&block) + pagination - concat content, block.binding + + unless ActionView::Base.respond_to? :erb_variable + concat pagination + yield + concat pagination + else + content = pagination + capture(&block) + pagination + concat(content, block.binding) + end end # Renders a helpful message with numbers of displayed vs. total entries.