Skip to content
Browse files

remove :renderer from global pagination_options to discourage using it

Because lately it's popular to mount different web frameworks in the
same Ruby process (e.g. Sinatra apps beside Rails), a global link
renderer option is useless since it would affect all frameworks but it's
hardly possible that a single renderer will work in all of these
frameworks.

See resolution for #176
  • Loading branch information...
1 parent 8ce2276 commit 3c1225168ea7c583dfe6b897fe52131f1c06e878 @mislav committed
Showing with 3 additions and 4 deletions.
  1. +2 −3 lib/will_paginate/view_helpers.rb
  2. +1 −1 lib/will_paginate/view_helpers/link_renderer.rb
View
5 lib/will_paginate/view_helpers.rb
@@ -28,7 +28,6 @@ class << self
:link_separator => ' ', # single space is friendly to spiders and non-graphic browsers
:param_name => :page,
:params => nil,
- :renderer => nil,
:page_links => true,
:container => true
}
@@ -49,8 +48,8 @@ class << self
# * <tt>:param_name</tt> -- parameter name for page number in URLs (default: <tt>:page</tt>)
# * <tt>:params</tt> -- additional parameters when generating pagination links
# (eg. <tt>:controller => "foo", :action => nil</tt>)
- # * <tt>:renderer</tt> -- class name, class or instance of a link renderer (default:
- # <tt>WillPaginate::LinkRenderer</tt>)
+ # * <tt>:renderer</tt> -- class name, class or instance of a link renderer (default in Rails:
+ # <tt>WillPaginate::ActionView::LinkRenderer</tt>)
# * <tt>:page_links</tt> -- when false, only previous/next links are rendered (default: true)
# * <tt>:container</tt> -- toggles rendering of the DIV container for pagination links, set to
# false only when you are rendering your own pagination markup (default: true)
View
2 lib/will_paginate/view_helpers/link_renderer.rb
@@ -35,7 +35,7 @@ def to_html
# Returns the subset of +options+ this instance was initialized with that
# represent HTML attributes for the container element of pagination links.
def container_attributes
- @container_attributes ||= @options.except(*(ViewHelpers.pagination_options.keys - [:class]))
+ @container_attributes ||= @options.except(*(ViewHelpers.pagination_options.keys + [:renderer] - [:class]))
end
protected

0 comments on commit 3c12251

Please sign in to comment.
Something went wrong with that request. Please try again.