Skip to content

Commit

Permalink
都道府県別の道場数に補足情報を追加した in Stats
Browse files Browse the repository at this point in the history
  • Loading branch information
yasulab committed Jan 23, 2025
1 parent 26dc587 commit aac9724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/stats_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def show
Prefecture.order(:id).each do |p|
@data_by_prefecture[p.name] = Dojo.active.where(prefecture_id: p.id).sum(:counter)
end
@data_by_prefecture_count = @data_by_prefecture.select{|k,v| v>0}.count
end
end

Expand Down
2 changes: 2 additions & 0 deletions app/views/stats/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@
%a{href: '#prefectures'}<
都道府県別の道場数
%div{style: 'padding-top: 10px; font-size: smaller;'}
= "(#{@data_by_prefecture_count} / #{Prefecture.count})"
%div{style: "margin-top: 20px;", align: 'center' }
%table{border: '1'}
%tr
Expand Down

0 comments on commit aac9724

Please sign in to comment.