Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen van Bergerem <svbergerem@online.de>2016-08-09 16:45:27 +0300
committerSteffen van Bergerem <svbergerem@online.de>2016-08-09 20:20:40 +0300
commitf1e9c99866aa19579b87d65648482774cbba61ff (patch)
treec234a2198ff99bf76f0766a111b97c1ae7b1f870 /app/controllers
parent73ce521bb3d9c51a94dce83db2a6ed7e656c1913 (diff)
Add contacts search
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/contacts_controller.rb11
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