Выполните следующие действия:
В config / initializers / devise.rb:
config.warden do |manager|
manager.failure_app = CustomAuthenticationFailure
end
Создайте новый файл с именем lib / custom_authentication_failure.rb:
class CustomAuthenticationFailure < Devise::FailureApp
protected
def redirect_url
root_path #or whatever route in your app that points to '/'
end
end
И это к вашему config / application.rb:
config.autoload_paths += %W(#{config.root}/lib)