0
0
Fork 0

Fix #72 - add follow/unfollow button to public profiles

This commit is contained in:
Eugen Rochko 2016-10-06 21:27:58 +02:00
parent 87ba52ad3f
commit 3554d638b3
7 changed files with 33 additions and 1 deletions

View file

@ -16,6 +16,16 @@ class AccountsController < ApplicationController
end
end
def follow
FollowService.new.call(current_user.account, @account.acct)
redirect_to account_path(@account)
end
def unfollow
UnfollowService.new.call(current_user.account, @account)
redirect_to account_path(@account)
end
def followers
@followers = @account.followers.order('follows.created_at desc').paginate(page: params[:page], per_page: 6)
end