class ApplicationController < ActionController::Base rescue_from CensorBear::NotPassedError, with: :censor_not_passed private def censor_not_passed redirect_to comments_path, flash: { notice: "内容含敏感信息" } end end