How to define custom Failure for devise in case of two different models User and active admin?
问题 I have two models User and ActiveAdmin on which I want to apply my devise integrations. I have my custom_failure.rb as follows class CustomFailure < Devise::FailureApp def redirect_url login_path end # def redirect_url # root_path # end def respond if http_auth? http_auth else redirect end end end Which seems to be working great. Also, can define in my application controller like : def after_sign_in_path_for(resource) # case resource if resource.is_a?(Admin) admin_dashboard_path else root