lib/kaminari/helpers/action_view_extension.rb in kaminari-0.16.1 vs lib/kaminari/helpers/action_view_extension.rb in kaminari-0.16.2
- old
+ new
@@ -13,10 +13,12 @@
# * <tt>:params</tt> - url_for parameters for the links (:controller, :action, etc.)
# * <tt>:param_name</tt> - parameter name for page number in the links (:page by default)
# * <tt>:remote</tt> - Ajax? (false by default)
# * <tt>:ANY_OTHER_VALUES</tt> - Any other hash key & values would be directly passed into each tag as :locals value.
def paginate(scope, options = {}, &block)
- paginator = Kaminari::Helpers::Paginator.new self, options.reverse_merge(:current_page => scope.current_page, :total_pages => scope.total_pages, :per_page => scope.limit_value, :remote => false)
+ options[:total_pages] ||= options[:num_pages] || scope.total_pages
+
+ paginator = Kaminari::Helpers::Paginator.new(self, options.reverse_merge(:current_page => scope.current_page, :per_page => scope.limit_value, :remote => false))
paginator.to_s
end
# A simple "Twitter like" pagination link that creates a link to the previous page.
#