In the application controller before filter.
class ApplicationController < ActionController::Base before_filter :authenticate def authenticate # How do we know which controller and action was targetted? end end
class ApplicationController < ActionController::Base before_filter :authenticate def authenticate # How do we know which controller and action was targetted? params[:controller] params[:action] # OR controller.controller_name controller.action_name end end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With