我認爲Rails 3.1正在改變錯誤發生的方式。任何人都可以協助或證實此事?我試圖用Rails 3.1.0創建自定義錯誤頁面.rc1Rails 3.1錯誤捕獲
unless config.consider_all_requests_local
rescue_from Exception, :with => :render_error
rescue_from ActiveRecord::RecordNotFound, :with => :render_not_found
rescue_from ActionController::RoutingError, :with => :render_not_found
rescue_from ActionController::UnknownController, :with => :render_not_found
rescue_from ActionController::UnknownAction, :with => :render_not_found
end
^^這不起作用。
config.consider_all_requests_local = true
這是在我的開發環境默認情況下。我假設Rails 3.1刪除了「action_controller」,但我無法在任何地方證實這一點。
謝謝!
什麼樣的錯誤?一般來說是例外嗎? – Matchu 2011-05-25 04:00:11
如果您可以發佈一些代碼並解釋您所看到的具體*意外行爲,將會有所幫助。 – molf 2011-05-25 09:46:35
你應該接受下面的答案。有用! – 2011-09-29 07:59:52