Module: DataMapper::Pagination::Helpers::Rails

Defined in:
lib/dm-pager/helpers/rails.rb

Instance Method Summary collapse

Instance Method Details

#paginate(collection, options = {}) ⇒ Object

Renders the pagination links for the given collection.

Options

:params  Hash of params that is passed to url_for
:size    Number of intermediate page number links to be shown; Defaults to 7


12
13
14
15
# File 'lib/dm-pager/helpers/rails.rb', line 12

def paginate collection, options = {}
  uri = @template.url_for @template.params.merge(options[:params] || {})
  collection.pager.to_html uri, options
end