Refactor topics controller. Add Common abilities. Add destroy action.

This commit is contained in:
taitus
2017-09-06 13:30:12 +02:00
parent 5ea16976f7
commit 64774b0d2d
10 changed files with 76 additions and 13 deletions

View File

@@ -9,7 +9,7 @@
<% topics.each do |topic| %>
<div id="<%= dom_id(topic) %>" class="panel column">
<div class="small-10 column">
<div class="small-8 column">
<h3><%= link_to topic.title, community_topic_path(@community, topic) %></h3>
@@ -24,9 +24,10 @@
</div>
<div class="small-2 column text-right">
<div class="small-4 column text-right">
<% if topic.author == current_user %>
<%= link_to t("community.show.topic.edit_button"), edit_community_topic_path(@community.id, topic), class: 'button small hollow' %>
<%= link_to t("community.show.topic.destroy_button"), community_topic_path(@community.id, topic), method: :delete, class: 'button hollow alert small' %>
<% end %>
</div>