diff options
author | Steffen van Bergerem <svbergerem@online.de> | 2016-08-09 16:45:27 +0300 |
---|---|---|
committer | Steffen van Bergerem <svbergerem@online.de> | 2016-08-09 20:20:40 +0300 |
commit | f1e9c99866aa19579b87d65648482774cbba61ff (patch) | |
tree | c234a2198ff99bf76f0766a111b97c1ae7b1f870 /app/controllers | |
parent | 73ce521bb3d9c51a94dce83db2a6ed7e656c1913 (diff) |
Add contacts search
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/contacts_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 3ffdadeac..c23380341 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -23,6 +23,17 @@ class ContactsController < ApplicationController end end + def search + @people = Person.search(params[:q], current_user, only_contacts: true).limit(15) + + respond_to do |format| + format.json do + @people = @people.limit(15) + render json: @people + end + end + end + def spotlight @spotlight = true @people = Person.community_spotlight |