In the application controller before filter.
class ApplicationController < ActionController::Base before_filter :authenticate def authenticate # How
request.parameters['controller'] request.parameters['action']