This way the relationship between the two elements is more obvious. And since now the button and the form are siblings, it's easier to find one based on the other using CSS or JavaScript.
16 lines
415 B
Plaintext
16 lines
415 B
Plaintext
<div class="related-content padding">
|
|
|
|
<h2 class="inline-block">
|
|
<%= t("related_content.title") %> <span>(<%= relationable.relationed_contents.count %>)</span>
|
|
</h2>
|
|
|
|
<% if current_user %>
|
|
<%= render "relationable/form", relationable: relationable %>
|
|
<% end %>
|
|
|
|
<% if @related_contents.present? %>
|
|
<%= render "relationable/related_list", relationable: relationable %>
|
|
<% end %>
|
|
|
|
</div>
|