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|
contacts.sort_by! {|contact| contact.person.name }
}
}.inject(:+)
}.inject(:+).paginate(:page => params[:page], :per_page => 25)
end
def set_up_contacts_mobile

View file

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