class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :null_session
rescue_from ActiveRecord::RecordNotFound, :with => record_not_found #spazzing out
def record_not_found
flash[:error] = 'Could not find specified role'
redirect_to record_not_found_path
true
end
end
那怎么错了?当我尝试运行规范时,我得到:
in `<class:ApplicationController>': undefined local variable or method `record_not_found' for ApplicationController:Class (NameError)
我错过了什么吗