Created
March 7, 2012 01:11
-
-
Save notch8-old/1990231 to your computer and use it in GitHub Desktop.
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
if defined?(WillPaginate) | |
module WillPaginate | |
module ActiveRecord | |
module RelationMethods | |
alias_method :per, :per_page | |
alias_method :num_pages, :total_pages | |
alias_method :total_count, :count | |
end | |
end | |
end | |
end | |
module WillPaginate | |
module ActionView | |
class LinkRenderer < ViewHelpers::LinkRenderer | |
def url(page) | |
@base_url_params ||= begin | |
url_params = merge_get_params(default_url_params) | |
merge_optional_params(url_params) | |
end | |
url_params = @base_url_params.dup | |
add_current_page_param(url_params, page) | |
@template.main_app.url_for(url_params) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment