Unobtrusive pagination_links_remote
This commit is contained in:
parent
c173cf4a6a
commit
a47d4b1f0e
3 changed files with 9 additions and 4 deletions
|
|
@ -22,15 +22,14 @@ module ApplicationHelper
|
|||
def pagination_links_remote(collection, options = {})
|
||||
per_page = options[:per_page] || @per_page
|
||||
params = options[:params] || {}
|
||||
update = options[:update] || nil
|
||||
|
||||
# Translations
|
||||
previous_label = '« ' + "Vorherige"
|
||||
next_label = "Nächste" + ' »'
|
||||
# Merge other url-options for will_paginate
|
||||
params = params.merge({:per_page => per_page})
|
||||
will_paginate collection, { :params => params, :remote => true, :update => update,
|
||||
:previous_label => previous_label, :next_label => next_label, }
|
||||
will_paginate collection, :params => params, 'data-remote' => remote,
|
||||
:previous_label => previous_label, :next_label => next_label
|
||||
end
|
||||
|
||||
# Link-collection for per_page-options when using the pagination-plugin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue