Skip to content

Instantly share code, notes, and snippets.

@notch8-old
Created March 7, 2012 01:11
Show Gist options
  • Save notch8-old/1990231 to your computer and use it in GitHub Desktop.
Save notch8-old/1990231 to your computer and use it in GitHub Desktop.
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