Created
April 27, 2019 01:15
-
-
Save rodloboz/1f50455fac1edb151e4ba19637d6b613 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="follow-btn"> | |
<% if current_user.is_following?(user) %> | |
<%= link_to user_unfollow_path(user.username), method: :delete, | |
data: { | |
action: 'ajax:success->follow#update' | |
}, | |
remote: true do | |
%> | |
<button class="btn btn-blue ml-4">Unfollow</button> | |
<% end %> | |
<% else %> | |
<%= link_to user_follow_path(user.username), method: :post, | |
data: { | |
action: 'ajax:success->follow#update' | |
}, | |
remote: true do | |
%> | |
<button class="btn btn-blue ml-4">Follow</button> | |
<% end %> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment