我有一个before_filter,它可以确保session[:event_id]的存在,并在不存在的情况下重定向到select_event。但是,我把它去掉了,一切都很好。所以,现在的问题变成了Why did having session[:user] = nil cause the observed behavior?
在Postman中,在body -> form-data部分- all I have's file作为key和一个图像作为value,它成功发布(file_path、id和电子邮件发送到数据库)。但是,在浏览器中-我收到一个500错误,显示:ErrorException: Trying to get property 'id' of non-object in file 我甚至尝试过删除formData.append