Class: FollowersController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/followers_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



22
23
24
25
26
# File 'app/controllers/followers_controller.rb', line 22

def destroy
  current_contact.relation_ids = Array.new

  respond_to :js
end

#indexObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/followers_controller.rb', line 6

def index
  @followings = current_subject.following_actor_objects.includes(:actor)
  @followers = current_subject.followers

  respond_to do |format|
    format.html
    format.json { render :text => to_json(@followers) }
  end
end

#updateObject



16
17
18
19
20
# File 'app/controllers/followers_controller.rb', line 16

def update
  current_contact.relation_ids = Array.wrap(Relation::Follow.instance.id)

  respond_to :js
end