I had the same problem. I wrote my own LinkRenderer like this to fully use nested routes.
class PaginationListLinkRenderer < WillPaginate::ViewHelpers::LinkRenderer
protected
def page_number(page)
unless page == current_page
if !@options[:params][:url].to_s.empty?
tag(:li, link(page, @options[:params][:url] + "?page=" + page.to_s))
else
tag(:li, link(page, page, :rel => rel_value(page)))
end
else
tag(:li, page, :class => "current")
end
end
def previous_or_next_page(page, text, classname)
if page
if !@options[:params][:url].to_s.empty?
tag(:li, link(text, @options[:params][:url] + "?page=" + page.to_s, :class => classname))
else
tag(:li, link(text, page, :rel => rel_value(page), :class => classname))
end
#tag(:li, link(text, page), :class => classname)
else
tag(:li, text, :class => classname + ' disabled')
end
end
def html_container(html)
tag(:ul, html, container_attributes)
end
end
Then you have to call will_paginate with this parameters:
<%= will_paginate :params => { :url => project_task_lists_path(@project) }, :renderer => PaginationListLinkRenderer %>
I hope this helps :)