Add more data routes
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
class StatisticsController < ApplicationController
|
||||
include StatisticsHelper
|
||||
|
||||
before_action :authorize!, only: [:graphs, :user_activity, :rfc_activity]
|
||||
|
||||
def policy_class
|
||||
StatisticsPolicy
|
||||
end
|
||||
|
||||
def show
|
||||
authorize self
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render(json: statistics_data) }
|
||||
@ -14,11 +15,23 @@ class StatisticsController < ApplicationController
|
||||
end
|
||||
|
||||
def graphs
|
||||
authorize self
|
||||
end
|
||||
|
||||
def user_activity
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render(json: graph_live_data) }
|
||||
format.json { render(json: user_activity_live_data) }
|
||||
end
|
||||
end
|
||||
|
||||
def rfc_activity
|
||||
respond_to do |format|
|
||||
format.json { render(json: rfc_activity_live_data) }
|
||||
end
|
||||
end
|
||||
|
||||
def authorize!
|
||||
authorize self
|
||||
end
|
||||
private :authorize!
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user