gpt4 book ai didi

ruby-on-rails - 在 rails 4 中显示语法错误

转载 作者:行者123 更新时间:2023-12-04 05:46:26 25 4
gpt4 key购买 nike

如何在 rails 4 中显示 slim 语法错误。当我使用 rails 3 和 slim all slim 语法错误时,当我迁移到 rails 4 时,我在浏览器中看到了 slim 语法错误,仅在控制台中显示。在浏览器中,我只看到 http 500 错误和消息 We're sorry, but something went wrong .如何在浏览器中显示语法错误?

例如如何显示此错误而不是 http 错误 500:

Started GET "/tests" for 127.0.0.1 at 2014-01-09 14:44:55 +0400
Processing by TestsController#index as HTML
Rendered tests/index.html.slim within layouts/application (2.2ms)
Completed 500 Internal Server Error in 5ms

ActionView::Template::Error (Text line not indented deep enough.
The first text line defines the necessary text indentation.
Are you trying to nest a child tag in a tag containing text? Use | for the text block!
/Users/sergey-chechaev/rails/project/test_rails_4/app/views/tests/index.html.slim, Line 2, Column 1
p = week_field_tag :week

最佳答案

在开发模式下,Slim 语法错误不会在浏览器中显示,因为目前正在讨论一个问题。引发异常时,Rails 4 和 Slim 似乎无法正常通信。

关注正在进行的讨论 on Github Slim问题页面

关于ruby-on-rails - 在 rails 4 中显示语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21018141/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com