I\'ve got a custom will_paginate renderer that overrides WillPaginate::ViewHelpers::LinkRenderer\'s link method like so:
def link(text, target, attributes = {
<%= will_paginate @user_friends, :renderer => 'FriendsRenderer',
:remote => true,
:link_path => friends_widget_user_path(@user) %>
class FriendsRenderer < WillPaginate::LinkRenderer
def prepare(collection, options, template)
@link_path = options.delete(:link_path)
super
end
protected
def link(page, text, attributes = {})
# Here you can use @link_path
end
end
Note that this works for the will-paginate version: 2.3.6