Module | ActionController::Pagination::ClassMethods |
In: |
vendor/rails/actionpack/lib/action_controller/pagination.rb
|
These methods become class methods on any controller
Creates a before_filter which automatically paginates an Active Record model for all actions in a controller (or certain actions if specified with the :actions option).
options are the same as PaginationHelper#paginate, with the addition of:
:actions: | an array of actions for which the pagination is active. Defaults to nil (i.e., every action) |
# File vendor/rails/actionpack/lib/action_controller/pagination.rb, line 124 124: def paginate(collection_id, options={}) 125: Pagination.validate_options!(collection_id, options, false) 126: module_eval do 127: before_filter :create_paginators_and_retrieve_collections 128: OPTIONS[self] ||= Hash.new 129: OPTIONS[self][collection_id] = options 130: end 131: end