Check for ActionController before injecting code