0
我試圖在成功註冊到各自的子域後重定向用戶。我在application_controller中輸入了下面的代碼。rails設計after_sign_up_path_for未定義的方法`子域'
application_controller.rb
protected
def after_sign_in_path_for(resource)
redirect_to root_url(subdomain: @users.subdomain)
end
我收到以下錯誤
NoMethodError in Devise::SessionsController#create
undefined method `subdomain' for nil:NilClass
Extracted source (around line #10):
def after_sign_up_path_for(subdomain)
redirect_to root_url(subdomain: @users.subdomain)
end