用户注册后,用户在after_sign_up_path_for(resource)上登陆RegistrationsController。
这个路径引导用户显示需要显示的屏幕。如果被邀请加入一个组,用户将在注册完组上的土地后,如果用户被邀请到社区中,它将在社区上登陆等等。重定向路径是通过store_location_for方法构建的。
我的问题是,在此之前,我如何进行额外的重定向?
我的目标是拥有一个Wellcome,然后在按钮上继续重定向到可以是组或社区的拉屏。
发布于 2020-04-12 18:30:17
您所需要做的就是重写after_signup_path_for方法:
def store_location_for
session[:location] = ...your location
end
def after_signup_path_for(resource_or_scope)
session[:location].present? ? redirect_to session[:location] : super
endhttps://stackoverflow.com/questions/61145041
复制相似问题