我正在使用 Hotwire 并在 Rails 6.0.3.6 应用程序上设计用户。
我为用户添加此广播
class User
after_create_commit { broadcast_append_to 'users' }
end
然后,当创建用户时,它会通过我尝试使用设计助手的部分(用户/用户)。current_user
但是 Rails 抛出这个错误:
Devise::MissingWarden in Players::Registrations#update
Devise could not find the `Warden::Proxy` instance on your request environment.
Make sure that your application is loading Devise and Warden as expected and that the `Warden::Manager` middleware is present in your middleware stack.
也许解决方案是能够告诉 Rails 以下内容:
如果从模型中,您尝试渲染他的默认部分(.to_partial_path),您需要向它传递一些局部变量,例如user: self
.
我怎么能对 Rails 这么说呢?
谢谢你的帮助