I am attempting to redirect user after successfully signing up to their respective subdomain. I have input the following code within the application_controller.
application_controller.rb
protected
def after_sign_in_path_for(resource)
redirect_to root_url(subdomain: @users.subdomain)
end
I am receiving the following error
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