Fix #72 - add follow/unfollow button to public profiles
This commit is contained in:
parent
87ba52ad3f
commit
3554d638b3
7 changed files with 33 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue