def log_access_to(model, opts={})
      after_filter(only: :index) do
        log_access
      end
    
      after_filter only: [:show, :create, :edit, :update, :destroy] do
        log_access instance_variable_get("@#{model}")
      end
    
      if opts[:through]
        opts[:through] = [ *opts[:through] ]
        opts[:through].each do |action|
          after_filter only: action do
            log_access instance_variable_get("@#{model}"), "#{action}ed"
          end
        end
      end
    end
def log_access_to(model, opts={})
      after_filter(only: :index) do
        log_access
      end
    
      after_filter only: [:show, :create, :edit, :update, :destroy] do
        log_access instance_variable_get("@#{model}")
      end
    
      if opts[:through]
        opts[:through] = [ *opts[:through] ]
        opts[:through].each do |action|
          after_filter only: action do
            log_access instance_variable_get("@#{model}"), "#{action}ed"
          end
        end
      end
    end
example usage:

   class ReportsController < ActionController::Base
     log_access_to :report, through: :print

     # restful actions here...

     def print
       @report = Report.find(params[:id])
     end
   end

 Also depends on the presence of a `current_anyone` method (probably on
 ApplicationController) to determine the user.