Sha256: cb40b54da26c3179e31a95694eb861a4a6bd8adcc197046289842200b0e90815

Contents?: true

Size: 695 Bytes

Versions: 75

Compression:

Stored size: 695 Bytes

Contents

class FollowersController < ApplicationController
  before_filter :authenticate_user!, :except => :index

  respond_to :html, :js

  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

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

    respond_to :js
  end

  def destroy
    current_contact.relation_ids = Array.new

    respond_to :js
  end

  private

  def current_contact
    @contact ||=
      current_subject.sent_contacts.find params[:id]
  end
end

Version data entries

75 entries across 75 versions & 2 rubygems

Version Path
social_stream-2.1.1 base/app/controllers/followers_controller.rb
social_stream-1.1.12 base/app/controllers/followers_controller.rb
social_stream-base-1.1.11 app/controllers/followers_controller.rb
social_stream-2.1.0 base/app/controllers/followers_controller.rb
social_stream-base-2.1.0 app/controllers/followers_controller.rb
social_stream-2.0.4 base/app/controllers/followers_controller.rb
social_stream-base-2.0.4 app/controllers/followers_controller.rb
social_stream-2.0.3 base/app/controllers/followers_controller.rb
social_stream-base-2.0.3 app/controllers/followers_controller.rb
social_stream-1.1.11 base/app/controllers/followers_controller.rb
social_stream-base-1.1.10 app/controllers/followers_controller.rb
social_stream-1.1.10 base/app/controllers/followers_controller.rb
social_stream-base-1.1.9 app/controllers/followers_controller.rb
social_stream-1.1.9 base/app/controllers/followers_controller.rb
social_stream-base-1.1.8 app/controllers/followers_controller.rb
social_stream-1.1.8 base/app/controllers/followers_controller.rb
social_stream-base-1.1.7 app/controllers/followers_controller.rb
social_stream-2.0.2 base/app/controllers/followers_controller.rb
social_stream-base-2.0.2 app/controllers/followers_controller.rb
social_stream-2.0.1 base/app/controllers/followers_controller.rb