Class: ContactsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/contacts_controller.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#indexObject


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/controllers/contacts_controller.rb', line 10

def index
  respond_to do |format|

    # Used for normal requests to contacts#index
    format.html { set_up_contacts }

    # Used by the mobile site
    format.mobile { set_up_contacts_mobile }

    # Used for mentions in the publisher and pagination on the contacts page
    format.json {
      @people = if params[:q].present?
                  mutual = params[:mutual].present? && params[:mutual]
                  Person.search(params[:q], current_user, only_contacts: true, mutual: mutual).limit(15)
                else
                  set_up_contacts_json
                end
      render json: @people
    }
  end
end

#spotlightObject


32
33
34
35
# File 'app/controllers/contacts_controller.rb', line 32

def spotlight
  @spotlight = true
  @people = Person.community_spotlight
end