Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

paginated_section: use new concat style in ActionPack 2.2 to avoid de…

…precation warnings
  • Loading branch information...
commit 787555f477e7bd71f83b651e8611a7a53026c2c5 1 parent 1cc7e0a
Mislav Marohnić mislav authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/will_paginate/view_helpers/action_view.rb
12 lib/will_paginate/view_helpers/action_view.rb
View
@@ -1,5 +1,6 @@
require 'will_paginate/view_helpers/base'
require 'action_view'
+require 'action_pack/version'
require 'will_paginate/view_helpers/link_renderer'
module WillPaginate
@@ -46,8 +47,15 @@ def page_entries_info(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
+
+ if ::ActionPack::VERSION::STRING.to_f >= 2.2
+ concat pagination
+ yield
+ concat pagination
+ else
+ content = pagination + capture(&block) + pagination
+ concat(content, block.binding)
+ end
end
protected
Please sign in to comment.
Something went wrong with that request. Please try again.