Display some stats

This commit is contained in:
Eloy Gomez
2015-08-08 14:33:44 +02:00
parent 02f19aa4b1
commit fe2080aff9
8 changed files with 85 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
class Api::StatsController < Api::ApiController
def show
event_type = params[:event]
unless event_type.present?
return render json: {}, status: :bad_request
end
render json: Ahoy::Event.where(name: event_type).group_by_day(:time).count
end
end