Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created March 23, 2009 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diasjorge/83399 to your computer and use it in GitHub Desktop.
Save diasjorge/83399 to your computer and use it in GitHub Desktop.
class RemoteLinkRenderer < WillPaginate::LinkRenderer
def prepare(collection, options, template)
@remote = options.delete(:remote)
super
end
protected
def page_link(page, text, attributes = {})
if @remote
@template.link_to_remote(text, {:url => url_for(page), :method => :get}.
merge(@remote), attributes)
else
@template.link_to(text, url_for(page), attributes)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment