Skip to content

Commit 5ab30c3

Browse files
committed
chore(tags): tags index loads relations
1 parent e509172 commit 5ab30c3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/controllers/tags_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class TagsController < ApplicationController
33
before_action :set_tag, only: [ :show, :edit, :update, :destroy ]
44

55
def index
6-
@tags = Tag.all
6+
@tags = Tag.includes(:cognates, :reverse_cognates).all
77
end
88

99
def new

app/views/tags/_list.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
</td>
77
<td class="text-bold-500">
88
<% tag.cognates.each do |cognate| %>
9-
<%= link_to cognate.name, tag_path(cognate), class: "badge bg-light-primary" %>
9+
<%= link_to cognate.name, tag_path(cognate), class: "badge bg-success" %>
1010
<% end %>
1111
<% tag.reverse_cognates.each do |cognate| %>
12-
<%= link_to cognate.name, tag_path(cognate), class: "badge bg-light-primary" %>
12+
<%= link_to cognate.name, tag_path(cognate), class: "badge bg-light-success" %>
1313
<% end %>
1414
</td>
1515
<td class="text-end">

0 commit comments

Comments
 (0)