Create new followables helper to have some methods previously on follows helper. Rename entity to followable.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-19 16:48:50 +02:00
parent 3be893b0ba
commit cba497b32e
6 changed files with 64 additions and 57 deletions

View File

@@ -5,14 +5,14 @@
<%= link_to "##{follow_link_wrapper_id(followable)}",
id: follow_link_wrapper_id(followable),
title: follow_entity_text(followable),
title: follow_text(followable),
data: { toggle: follow_drop_id(followable) },
class: 'button hollow' do %>
<%= t('shared.follow') %>
<% end %>
<div class="dropdown-pane" id="<%= follow_drop_id(followable) %>"
data-dropdown data-auto-focus="true">
<%= link_to follow_entity_text(followable),
<%= link_to follow_text(followable),
follows_path(followable_id: followable.id,
followable_type: followable.class.name),
method: :post, remote: true,
@@ -26,14 +26,14 @@
<% follow = followable.follows.where(user: current_user).first %>
<%= link_to "##{unfollow_link_wrapper_id(followable)}",
id: unfollow_link_wrapper_id(followable),
title: unfollow_entity_text(followable),
title: unfollow_text(followable),
data: { toggle: unfollow_drop_id(followable) },
class: 'button hollow' do %>
<%= t('shared.unfollow') %>
<% end %>
<div class="dropdown-pane" id="<%= unfollow_drop_id(followable) %>"
data-dropdown data-auto-focus="true">
<%= link_to unfollow_entity_text(followable),
<%= link_to unfollow_text(followable),
follow_path(follow),
method: :delete, remote: true,
id: unfollow_link_id(followable) %>