Rails before_filter and action identification Rails before_filter and action identification ruby-on-rails ruby-on-rails

Rails before_filter and action identification


The action_name method on the controller should give you what you're looking for. It's not documented, though, so there is no guarantee it won't disappear someday.

before_filter { |controller| logger.debug "Running before the #{controller.action_name} action" }