I have in my app two models for sign_in. Also i didn't generate any my controller for devise, all is build-in. My ApplicationController is such:
def after_sign_in_path_for(resource)
case resource
when User then request.referrer
when Admin::Admin then :admin_mainpage
end
end
def after_sign_up_path_for(resource)
root_path
end
def after_sign_out_path_for(resource_or_scope)
request.referrer
end
But, when i try to sign_up new user, devise is also sign_in user, and i get devise filter chain halted as require_no_authentication rendered or redirected
But how to do, that if i just sign_in in system i'm redirected to previous page, but when i'm registering new user i sign_in but redirect to root_path?