Sha256: 98c9e142b84fa194515669ddc55a965af259ddf5fb3243f9e7031669f0a3465e
Contents?: true
Size: 888 Bytes
Versions: 3
Compression:
Stored size: 888 Bytes
Contents
require_dependency "audit_rails/application_controller" module AuditRails class AuditsController < ApplicationController def index @audits = AuditRails::Audit.all respond_to do |format| format.html # index.html.erb format.json { render json: @audits } format.xls { send_data @audits.to_xls(:columns => [:user_name, :action, :description, :created_at], :headers => ['User name', 'Action', 'Details', 'When?']), filename: 'audits.xls'} end end def create add_to_audit("visit-site", "xyz", "Fake User") render :nothing => true, :status => 200, :content_type => 'text/html' end def analytics @analysis_by_user_name = AuditRails::Audit.analysis_by_user_name @analysis_by_page_views = AuditRails::Audit.analysis_by_page_views @total = AuditRails::Audit.count end end end
Version data entries
3 entries across 3 versions & 1 rubygems