rails2.3.2 ExceptionNotifier 配置
必须先在项目中要加入plugin
?
rescue_from Exception do |exception| pp exception case exception when "ActionController::NameError" flash[:error] = exception.message.to_s when "ActiveRecord::RecordNotFound" flash[:error] = exception.message.to_s when "ActionController::UnknownAction" flash[:error] = exception.message.to_s.split(".")[0] rescue "No action responded to #{params[:action]}" else return rescue_action_in_public(exception) end redirect_to :controller => 'blog', :action => "list" end
?哈哈,这样就大功告成了!!!