Skip to content

Commit aac9724

Browse files
committed
都道府県別の道場数に補足情報を追加した in Stats
1 parent 26dc587 commit aac9724

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

app/controllers/stats_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def show
115115
Prefecture.order(:id).each do |p|
116116
@data_by_prefecture[p.name] = Dojo.active.where(prefecture_id: p.id).sum(:counter)
117117
end
118+
@data_by_prefecture_count = @data_by_prefecture.select{|k,v| v>0}.count
118119
end
119120
end
120121

app/views/stats/show.html.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@
225225
%a{href: '#prefectures'}<
226226
227227
都道府県別の道場数
228+
%div{style: 'padding-top: 10px; font-size: smaller;'}
229+
= "(#{@data_by_prefecture_count} / #{Prefecture.count})"
228230
%div{style: "margin-top: 20px;", align: 'center' }
229231
%table{border: '1'}
230232
%tr

0 commit comments

Comments
 (0)