我有一个新的 rails 7 应用程序 [rails new devisetest],一个带有静态页面的简单控制器,并添加了设计 [gem 'devise' + rails g devise user]。所有默认值。根据设计说明将 Flash 消息添加到 application.html.erb
没有显示设计错误消息,但我看到它们是在控制台中生成的(或者至少,我看到呈现的消息但它们没有显示,并且我看到为 _links 部分呈现并且确实显示)在另一个测试中使用快速脚手架(并且已将设计视图复制到应用程序但未修改它们),显示脚手架的闪存消息但仍不显示设计。
如果我访问 http://localhost:3000/users/sign_up 并创建一个密码太短的用户,我会在日志中看到这一点
Started POST "/users" for ::1 at 2021-12-24 08:02:10 +0000
Processing by Devise::RegistrationsController#create as TURBO_STREAM
Parameters: {"authenticity_token"=>"[FILTERED]", "user"=>{"email"=>"asdf@asdf.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
TRANSACTION (0.1ms) begin transaction
User Exists? (2.7ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "asdf@asdf.com"], ["LIMIT", 1]]
TRANSACTION (0.2ms) rollback transaction
Rendering layout layouts/application.html.erb
Rendering /home/sroot/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/devise-4.8.1/app/views/devise/registrations/new.html.erb within layouts/application
Rendered /home/sroot/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/devise-4.8.1/app/views/devise/shared/_error_messages.html.erb (Duration: 0.7ms | Allocations: 582)
Rendered /home/sroot/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/devise-4.8.1/app/views/devise/shared/_links.html.erb (Duration: 0.2ms | Allocations: 92)
Rendered /home/sroot/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/devise-4.8.1/app/views/devise/registrations/new.html.erb within layouts/application (Duration: 3.9ms | Allocations: 2199)
Rendered layout layouts/application.html.erb (Duration: 77.5ms | Allocations: 4429)
Completed 200 OK in 473ms (Views: 78.7ms | ActiveRecord: 3.1ms | Allocations: 15288)
谁能指出我的错误?或者建议我可以遵循的其他步骤来更接近我的错误?
谢谢