Skip to content

Instantly share code, notes, and snippets.

@jpemberthy
Created September 28, 2010 17:15
Show Gist options
  • Save jpemberthy/601371 to your computer and use it in GitHub Desktop.
Save jpemberthy/601371 to your computer and use it in GitHub Desktop.
# will_paginate 3.0.pre2 Renderer for post action.
# use: will_paginate @foo, :renderer => 'PostLinkRenderer'
class PostLinkRenderer < WillPaginate::ViewHelpers::LinkRenderer
private
def link(text, target, attributes = {})
target = url(target) if target.is_a? Fixnum
attributes[:href] = target
attributes["data-method"] = "post"
attributes[:rel] = "nofollow"
tag(:a, text, attributes)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment