我在我的 rails 应用程序中创建了几个测试用户来测试登录。他们通过设置会话自动登录。
一旦我对用户登录感到满意,我就进入 rails 控制台并删除了用户
User.last.delete
但是,现在当我尝试加载 localhost:3000 时,我的浏览器仍在寻找我刚刚删除的用户号 14。
ActiveRecord::RecordNotFound in StaticPagesController#home
Couldn't find User with id=14
app/controllers/application_controller.rb:7:in `current_user'
app/views/static_pages/home.html.erb:2:in `_app_views_static_pages_home_html_erb___2558135612319095530_70269927858560'
Request
Parameters:
None
即使重新启动服务器并使用 in 完全清除数据库rake db:reset
也无济于事——这不应该破坏告诉我的应用程序查找 id=14 的任何会话问题吗?