Paginate contacts

This commit is contained in:
Steffen van Bergerem 2014-10-11 22:21:31 +02:00
parent d44300c7a2
commit 8cc5847aec
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