Skip to content

Commit

Permalink
remove :renderer from global pagination_options to discourage using it
Browse files Browse the repository at this point in the history
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 mislav#176
  • Loading branch information
mislav committed Sep 15, 2011
1 parent 8ce2276 commit 3c12251
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/will_paginate/view_helpers.rb
Expand Up @@ -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
}
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/will_paginate/view_helpers/link_renderer.rb
Expand Up @@ -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
Expand Down

0 comments on commit 3c12251

Please sign in to comment.