Skip to content

Commit 613cc0a

Browse files
committed
feat: /dojos/activity に道場IDを表示(/dojos と同じ形式)
- 道場名 (ID 番号) ヘッダーを /dojos と統一 - 道場名の下にIDを表示する形式も統一 - リンク先を道場詳細ページに変更(内部リンク化) - DRY原則に従い、両ページで同じ表示形式を維持
1 parent a5181fa commit 613cc0a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/views/dojos/activity.html.erb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<small>
3333
☯️
3434
<br class='ignore-pc'>
35-
道場名
35+
道場名 (ID 番号)
3636
</small>
3737
</th>
3838
<th>
@@ -61,7 +61,10 @@
6161
<tr>
6262
<td>
6363
<small>
64-
<a href="<%= dojo[:url] %>"><%= dojo[:name] %></a>
64+
<%= link_to dojo_path(dojo[:id]) do %>
65+
<%= dojo[:name] %><br>
66+
<small>(ID: <%= dojo[:id] %>)</small>
67+
<% end %>
6568
</small>
6669
</td>
6770
<td>

spec/requests/dojos_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,5 +369,12 @@
369369
# 掲載日は YYYY-MM-DD 形式で表示される
370370
expect(response.body).to match(@active_dojo.created_at.strftime("%Y-%m-%d"))
371371
end
372+
373+
it "displays dojo ID same as /dojos page" do
374+
get activity_dojos_path
375+
# /dojos ページと同じように ID が表示される
376+
expect(response.body).to include("(ID: #{@active_dojo.id})")
377+
expect(response.body).to include("道場名 (ID 番号)")
378+
end
372379
end
373380
end

0 commit comments

Comments
 (0)