我有以下代碼:rescue_from ::一個AbstractController :: ActionNotFound不工作
unless Rails.application.config.consider_all_requests_local
rescue_from Exception, with: :render_exception
rescue_from ActiveRecord::RecordNotFound, with: :render_exception
rescue_from ActionController::UnknownController, with: :render_exception
rescue_from ::AbstractController::ActionNotFound, with: :render_exception
rescue_from ActiveRecord::ActiveRecordError, with: :render_exception
rescue_from NoMethodError, with: :render_exception
end
他們所有的工作完美無瑕,除了::一個AbstractController :: ActionNotFound
我也試過
AbstractController::ActionNotFound
ActionController::UnknownAction
錯誤:
AbstractController::ActionNotFound (The action 'show' could not be found for ProductsController):