Refactors shared/_tags view to always take a param called taggable

This commit is contained in:
kikito
2015-09-15 15:28:14 +02:00
parent 21c9f3fead
commit d324c061b3
5 changed files with 4 additions and 5 deletions

View File

@@ -18,7 +18,7 @@
<%= link_to debate.description, debate %>
<div class="truncate"></div>
</div>
<%= render "shared/tags", debate: debate, limit: 5 %>
<%= render "shared/tags", taggable: debate, limit: 5 %>
</div>
</div>

View File

@@ -59,7 +59,7 @@
<%= safe_html_with_links @debate.description %>
<%= render 'shared/tags', debate: @debate %>
<%= render 'shared/tags', taggable: @debate %>
<div class='js-moderator-debate-actions'>
<%= render 'actions', debate: @debate %>

View File

@@ -17,7 +17,7 @@
<%= link_to proposal.summary, proposal %>
<div class="truncate"></div>
</div>
<%= render "shared/tags", proposal: proposal, limit: 5 %>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
</div>
</div>

View File

@@ -74,7 +74,7 @@
<h4><%= @proposal.question %></h4>
<%= render 'shared/tags', proposal: @proposal %>
<%= render 'shared/tags', taggable: @proposal %>
<div class='js-moderator-proposal-actions'>
<%= render 'actions', proposal: @proposal %>

View File

@@ -1,5 +1,4 @@
<%- limit ||= nil %>
<%- taggable = defined?(debate) ? debate : proposal %>
<% if taggable.tags.any? %>
<span class='tags'>