diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 462bc1692cfd7f0e285b9c56f2328ebd460f0d96..9a57ba3e43d613c379e4e4987cb4cbfb50dadfc8 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -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 diff --git a/app/views/contacts/index.html.haml b/app/views/contacts/index.html.haml index 6bf43a51315908b1f9e9ff5e698b1f4e3d5eaac8..4d8f223b4f246903255956b540efea0546b012bf 100644 --- a/app/views/contacts/index.html.haml +++ b/app/views/contacts/index.html.haml @@ -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