Skip to content

Commit 4f1a31a

Browse files
committed
feat: テーブルセクションへの内部リンクを追加(#table)
- h3タグにid='table'を追加し、📊アイコンを内部リンクに - 対象期間セレクトボックスの自動遷移に#tableアンカーを追加 - '全道場を表示'リンクにも#tableアンカーを追加 - ページ遷移後に自動的にテーブル位置へスクロール
1 parent 88937e7 commit 4f1a31a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/views/dojos/index.html.erb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@
2828

2929
<!-- 年次データフィルタリング -->
3030
<div style="margin: 30px auto; padding: 20px; background: #f8f9fa; border-radius: 8px; max-width: 600px;">
31-
<h3>📊 年次データのフィルタリング</h3>
31+
<h3 id="table">
32+
<a href="#table">📊</a>
33+
年次データのフィルタリング
34+
</h3>
3235

3336
<% if @selected_year %>
3437
<div style="padding: 10px; background: #d1ecf1; border: 1px solid #bee5eb; border-radius: 4px; margin-bottom: 15px;">
3538
<strong><%= @selected_year %>年末時点</strong>のアクティブな道場を表示中
36-
<%= link_to '全道場を表示', dojos_path, style: 'margin-left: 10px;' %>
39+
<%= link_to '全道場を表示', dojos_path(anchor: 'table'), style: 'margin-left: 10px;' %>
3740
</div>
3841
<% end %>
3942

@@ -45,7 +48,7 @@
4548
params[:year]
4649
),
4750
include_blank: '全期間',
48-
onchange: "window.location.href = '#{dojos_path}?year=' + this.value",
51+
onchange: "window.location.href = '#{dojos_path}?year=' + this.value + '#table'",
4952
style: 'padding: 5px; border: 1px solid #ced4da; border-radius: 4px; cursor: pointer;' %>
5053

5154
<%= link_to 'CSV', dojos_path(format: :csv, year: params[:year]),

0 commit comments

Comments
 (0)