Ruby on rails Rails对goes to link作出响应,但不加载页面

Ruby on rails Rails对goes to link作出响应,但不加载页面,ruby-on-rails,ruby,Ruby On Rails,Ruby,在rails 6.0.3.1上,我尝试使用一个简单的respond_to语句来通知用户他们已经成功地与我的系统进行了交互。这是我的密码: @conversation = Conversation.new(p) respond_to do |format| if @conversation.save format.html { redirect_to @conversation, notice: 'Conversation was successfully created.

在rails 6.0.3.1上,我尝试使用一个简单的respond_to语句来通知用户他们已经成功地与我的系统进行了交互。这是我的密码:

@conversation = Conversation.new(p)
respond_to do |format|
    if @conversation.save
        format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }
        format.json { render :show, status: :created, location: @conversation }
    else
        format.html { render :new }
        format.json { render json: @conversation.errors, status: :unprocessable_entity }
    end
end
该代码随后会将正确的链接输入浏览器,但不会加载正确的页面,也不会将通知打印到屏幕上。然后,用户可以刷新页面,将其带到正确的页面,但显然,它应该自动将用户带到该页面,而不是强制用户点击刷新按钮。以下是chrome浏览器中弹出的图像:

我在代码的其他地方也有类似的问题。我是rails新手。谢谢你的帮助