Sergey Chechaev
Sergey Chechaev

Reputation: 570

Show syntax error in rails 4

How to show slim syntax error in rails 4. When i used rails 3 and slim all slim syntax error i see in browser when i migrate to rails 4 the slim syntax error shown only in console. In browser i only see http 500 error and message We're sorry, but something went wrong. How to show syntax error in browser?

For example how to show this error instead http error 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

Upvotes: 3

Views: 654

Answers (1)

Kirti Thorat
Kirti Thorat

Reputation: 53038

In development mode, Slim syntax errors are not shown in the browser as there is an issue which is currently under discussion. It seems like Rails 4 and Slim are not communicating properly when the exception is raised.

Follow the ongoing discussion on Github Slim issue page

Upvotes: 4

Related Questions