0
@@ -92,8 +92,17 @@ module WillPaginate
0
options = options.symbolize_keys.reverse_merge WillPaginate::ViewHelpers.pagination_options
0
# create the renderer instance
0
- renderer_class = options[:renderer].to_s.constantize
0
- renderer = renderer_class.new collection, options, self
0
+ renderer = case options[:renderer]
0
+ renderer_class = options[:renderer].to_s.constantize
0
+ renderer_class.new collection, options, self
0
+ returning(options[:renderer]) do |r|
0
+ r.collection = collection
0
# render HTML for pagination
0
@@ -169,6 +178,9 @@ module WillPaginate
0
# This class does the heavy lifting of actually building the pagination
0
# links. It is used by +will_paginate+ helper internally.
0
+ attr_accessor :collection, :options, :template
0
# * +collection+ is a WillPaginate::Collection instance or any other object
0
# that conforms to that API
0
# * +options+ are forwarded from +will_paginate+ view helper
0
@@ -258,12 +270,21 @@ module WillPaginate
0
classnames = Array[*span_class]
0
if page and page != current_page
0
- @template.link_to text, url_for(page), :rel => rel_value(page), :class => classnames[1]
0
+ page_link page, text, :rel => rel_value(page), :class => classnames[1]
0
- @template.content_tag :span, text, :class => classnames.join(' ')
0
+ page_span page, text, :class => classnames.join(' ')
0
+ def page_link(page, text, attributes = {})
0
+ @template.link_to text, url_for(page), attributes
0
+ def page_span(page, text, attributes = {})
0
+ @template.content_tag :span, text, attributes
0
# Returns URL params for +page_link_or_span+, taking the current GET params
0
# and <tt>:params</tt> option into account.
Comments
No one has commented yet.