Tôi đã đoạn mã sau:rescue_from :: AbstractController :: ActionNotFound không làm việc
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
Họ tất cả công việc hoàn hảo, ngoại trừ :: AbstractController :: ActionNotFound
Tôi cũng cố gắng
AbstractController::ActionNotFound
ActionController::UnknownAction
lỗi:
AbstractController::ActionNotFound (The action 'show' could not be found for ProductsController):