application_controller.rb
class ApplicationController < ActionController::Base
protect_from_forgery
rescue_from ActiveRecord::RecordInvalid, :with => :error_render_method
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
def error_render_method
end
def record_not_found
end
end
当我运行时,rspec
我收到此错误:
uninitialized constant ActiveRecord::RecordInvalid (NameError)
我用谷歌搜索,发现有些人添加require 'active_record/errors'
到该文件中,但是当我这样做时,错误仍然存在。
我在用rails (3.2.9)