In routes i have the root-path pointing \"home#index\"
but when i try to override that with after_sign_up_path_for keeps redirecting me to the root path when I
In my particular case, the after sign up path was not working: but I was using OmniAuth with a custom callback controller, which was invoking the after_sign_in_path_for
rather than the former:
def google_oauth2 @user = User.from_omniauth(request.env["omniauth.auth"])
if @user.persisted?
# Here's the guilty line your honour:
sign_in_and_redirect @user, event: :authentication #this will throw if @user is not activated
set_flash_message(:notice, :success, kind: "Google") if is_navigational_format?
else
session["devise.google_oauth2_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
end
........And the sign_in_and_redirect
path redirects to the after_sign_in_path_for
method. So I generated a new devise controller for sessions and simply overrode that method. problem solved!