Skip to content

Instantly share code, notes, and snippets.

@brenoperucchi
Created July 3, 2013 20:56
Show Gist options
  • Save brenoperucchi/5922744 to your computer and use it in GitHub Desktop.
Save brenoperucchi/5922744 to your computer and use it in GitHub Desktop.
WillPaginate customizes attributes of link_to (html a)
#Add in your project in config/initializers/will_paginate.rb
#in my case I'm adding the attribute page_number with value of target
WillPaginate::ActionView::LinkRenderer.class_eval do
def link(text, target, attributes = {})
attributes.merge!(page_number: "#{target}")
super text, target, attributes
end
end
#please let me know if this helped someone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment