Permalink
Browse files

fix will paginate renderer

  • Loading branch information...
1 parent 39ee27a commit d626148a83552fa81624f75b23d539f45ec6354e Diaspora Europe committed Mar 16, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 config/initializers/will_paginate.rb
@@ -5,7 +5,11 @@
module WillPaginate
module ActionView
- def will_paginate(collection = nil, options = { :renderer => WillPaginate::ActionView::LinkRenderer } )
+ def will_paginate(collection = nil, options = {} )
+ options, collection = collection, nil if collection.is_a? Hash
+ # Taken from original will_paginate code to handle if the helper is not passed a collection object.
+ collection ||= infer_collection_from_controller
+ options[:renderer] ||= WillPaginate::ActionView::LinkRenderer
super.try :html_safe
end

0 comments on commit d626148

Please sign in to comment.