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 sign in or sign up. I have tried to put it in both in devise subclassed controller and application_controller, but it didn't work. What do I need to do here?
Application controller
class ApplicationController < ActionController::Base
protect_from_forgery
def after_sign_up_path_for(resource)
show_cities_path(resource)
end
end
registration controller
class RegistrationsController < ApplicationController
def after_sign_up_path_for(resource)
show_cities_path(resource)
end
end
routes
root :to => "home#index"
If you also have the Confirmable module enabled, you have to override after_inactive_sign_up_path_for
since a new sign-up is "inactive" until it's confirmed. after_sign_up_path_for
doesn't seem to get called when Confirmable is active.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With