displays total stat count
This commit is contained in:
@@ -4,6 +4,7 @@ class StatsController < ApplicationController
|
||||
|
||||
def show
|
||||
@event_types = Ahoy::Event.select(:name).uniq.pluck(:name)
|
||||
@debates_created_count = Ahoy::Event.where(name: 'debate_created').count
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<h2>Stats</h2>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<h3>Visits</h3>
|
||||
<h3>Visits (<%= Visit.count %>) </h3>
|
||||
<%= visits_chart_tag id: "visits" %>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<div class="small-12">
|
||||
<% @event_types.each do |event_type| %>
|
||||
<h3><%= event_type.titleize %></h3>
|
||||
<h3><%= event_type.titleize %> (<%= @debates_created_count %>)</h3>
|
||||
<%= events_chart_tag event_type %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user