Merge pull request #5335 from svbergerem/paginate-contacts

Paginate contacts
This commit is contained in:
Jonne Haß 2014-11-09 19:04:07 +01:00
commit 30de98cf3e
2 changed files with 3 additions and 3 deletions

View file

@ -65,7 +65,7 @@ class ContactsController < ApplicationController
relation.includes(:person => :profile).to_a.tap {|contacts| relation.includes(:person => :profile).to_a.tap {|contacts|
contacts.sort_by! {|contact| contact.person.name } contacts.sort_by! {|contact| contact.person.name }
} }
}.inject(:+) }.inject(:+).paginate(:page => params[:page], :per_page => 25)
end end
def set_up_contacts_mobile def set_up_contacts_mobile

View file

@ -11,8 +11,8 @@
= render 'contacts/header' = render 'contacts/header'
- if @contacts_size > 0 - if @contacts_size > 0
- @contacts.each do |contact| = render @contacts
= render 'contacts/contact', :contact => contact = will_paginate @contacts
- else - else
.no_contacts .no_contacts
%h3 %h3