我按照https://github.com/GoogleCloudPlatform/cloudml-samples/blob/master/flowers/trainer/model.py#L393的说明进行了操作
当我运行rake db:migrate
时,我收到以下错误:
NameError: undefined local variable or method 'current_user' for
TomtomCusu::Application:Class
该方法在 application_controller.rg
中定义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: :exception
private
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
helper_method :current_user
end