Created
August 30, 2012 16:13
-
-
Save iamvery/3532052 to your computer and use it in GitHub Desktop.
Shows how one might set a default will_paginate link renderer in a rails application
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
| module ApplicationHelper | |
| # This method is overriding the view helper provided by `will_paginate` | |
| def will_paginate(collection_or_options = nil, options = {}) | |
| options, collection_or_options = collection_or_options, nil if collection_or_options.is_a? Hash | |
| options.merge! :renderer => YourCustomLinkRenderer unless options[:renderer] | |
| super *[collection_or_options, options].compact | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment