Files
grecia/app/views/follows/_follow_button.html.erb
2017-12-07 11:12:46 +01:00

20 lines
753 B
Plaintext

<div class="js-follow">
<span class="followable-content">
<% if follow.followable.followed_by?(current_user) %>
<%= link_to t('shared.following'),
follow_path(follow),
method: :delete, remote: true,
title: unfollow_text(follow.followable),
class: 'button expanded' %>
<% else %>
<%= link_to follow_text(follow.followable),
follows_path(followable_id: follow.followable.id,
followable_type: follow.followable.class.name),
method: :post, remote: true,
title: follow_text(follow.followable),
class: 'button hollow expanded' %>
<% end %>
</span>
</div>