0
我試圖在用戶登錄後刷新Geokit位置到會話。我有以下代碼。after_sign_in_path_for action not loading Rails中的Geokit
# app/controllers/application_controller.rb
def after_sign_in_path_for(resource_or_scope)
session[:geo_location] = User.geocode(current_user.city)
end
但是我收到以下錯誤。
NoMethodError in Devise::SessionsController#create
undefined method `model_name' for Geokit::GeoLoc:Class
似乎像Geokit沒有加載之前的設計控制器。任何想法?