Permalink
Browse files

make `page_entries_info` output html_safe

  • Loading branch information...
1 parent b11cfff commit 7288d61091f5873c6fad38bb7241ac0bc982c669 Tobi Knaup committed with Nov 26, 2010
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/will_paginate/view_helpers.rb
@@ -168,7 +168,7 @@ def page_entries_info(collection, options = {})
entry_name = options[:entry_name] ||
(collection.empty?? 'entry' : collection.first.class.name.underscore.sub('_', ' '))
- if collection.total_pages < 2
+ output = if collection.total_pages < 2
case collection.size
when 0; "No #{entry_name.pluralize} found"
when 1; "Displaying <b>1</b> #{entry_name}"
@@ -181,10 +181,7 @@ def page_entries_info(collection, options = {})
collection.total_entries
]
end
- end
-
- if respond_to? :safe_helper
- safe_helper :will_paginate, :paginated_section, :page_entries_info
+ output.respond_to?(:html_safe) ? output.html_safe : output
end
def self.total_pages_for_collection(collection) #:nodoc:

0 comments on commit 7288d61

Please sign in to comment.