Merge pull request #5335 from svbergerem/paginate-contacts
Paginate contacts
This commit is contained in:
commit
30de98cf3e
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue