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
# File 'app/controllers/contacts_controller.rb', line 10

def index
  respond_to do |format|

    # Used for normal requests to contacts#index and subsequent infinite scroll calls
    format.html { set_up_contacts }

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

    # Used to populate mentions in the publisher
    format.json {
      aspect_ids = params[:aspect_ids] || current_user.aspects.map(&:id)
      @people = Person.all_from_aspects(aspect_ids, current_user).for_json
      render :json => @people.to_json
    }
  end
end

#sharingObject


28
29
30
31
# File 'app/controllers/contacts_controller.rb', line 28

def sharing
  @contacts = current_user.contacts.sharing.includes(:aspect_memberships)
  render :layout => false
end

#spotlightObject


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

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