如何在rails 4中显示纤薄的语法错误。当我使用rails 3并修剪所有纤细的语法错误时,我在浏览器中看到,当我迁移到rails 4时,仅在控制台中显示了纤细的语法错误。在浏览器中,我只看到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
答案 0 :(得分:4)
在开发模式下,浏览器中未显示Slim
语法错误,因为目前正在讨论一个问题。当引发异常时,似乎Rails 4和Slim没有正确通信。
按照正在进行的讨论on Github Slim问题页面
进行操作