# 1. I am saving results to database # rails generate model Action controller:string action_name:string count:integer # 2. add after_filter to increase count of executed action class ApplicationController < ActionController::Base after_filter :save_action # ... other logic def save_action a = Action.where(controller: params[:controller], action_name: params[:action]).first_or_create a.increment!(:count) end end