Skip to content

Commit 27928f4

Browse files
committed
fix: 全期間選択時のURLをシンプルに(/dojos#table)
- 全期間選択時は ?year= パラメータを付けない - /dojos?year=#table → /dojos#table に修正 - 三項演算子で値がある場合とない場合を判定
1 parent 0d07eb4 commit 27928f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/dojos/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
params[:year]
4848
),
4949
include_blank: '全期間',
50-
onchange: "window.location.href = '#{dojos_path}?year=' + this.value + '#table'",
50+
onchange: "window.location.href = this.value ? '#{dojos_path}?year=' + this.value + '#table' : '#{dojos_path}#table'",
5151
style: 'padding: 5px; border: 1px solid #ced4da; border-radius: 4px; cursor: pointer;' %>
5252

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

0 commit comments

Comments
 (0)