Created
July 3, 2013 20:56
-
-
Save brenoperucchi/5922744 to your computer and use it in GitHub Desktop.
WillPaginate customizes attributes of link_to (html a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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