0

我有一个带有嵌套资源的 form_for。这是演示我的设置的嵌套路由。

   resources :residents do
    resources :assessment_plan_forms
    resources :blood_pressure_record_forms
    resources :fund_record_form1s
    resources :fund_record_form2s
    resources :id_record_forms
    resources :incident_accident_forms
    resources :med_record_forms
    resources :personal_care_forms
    resources :resident_care_agreement_forms
    resources :visitation_appointment_forms
    resources :weight_record_forms
  end

我可以从 resident/show 视图(它提供您在嵌套资源片段中看到的所有表单)成功导航到assessment_plan_form/new 视图,没有任何问题。

但是,当我单击表单上的提交按钮时,我收到以下错误。

No data received
Unable to load the webpage because the server sent no data.
Here are some suggestions:
Reload this webpage later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

当我单击 chrome 提供的重新加载超链接时,我能够成功重定向到assessment_plan_form/show 视图。

我希望能够深入了解问题所在以及解决此问题的解决方案。

我已包含以下要点链接供您考虑。如果我需要提供更多信息,请告诉我,我会提供。

Gist Link - 包括代码片段、服务器日志和路由

4

1 回答 1

0

虽然我不确定为什么会这样,但这是我用来删除错误 324 (net::ERR_EMPTY_RESPONSE) 的解决方案:服务器关闭连接而不发送任何数据。

首先,这个问题发生在 Firefox 17 和 Chrome 23 中。当我将瘦服务器添加到我的 Gemfile、运行捆绑并重新启动服务器时,我能够消除错误。

这消除了 324 错误,但目前我无法让提交按钮重定向到显示操作。没有异常生成,如果我在模型中添加表单验证,页面只会刷新。

我将继续排除故障并创建一个与提交按钮有关的新问题,如果需要,我不会重定向。

于 2012-12-26T20:34:34.183 回答