Haml::SyntaxError in Recipes#new
Showing /home/shoaib/Documents/Projects/recipe_box/app/views/recipes/_form.html.haml where line #4 raised:
The line was indented 4 levels deeper than the previous line.
Extracted source (around line #4):
2
3
4
5
6
7
- if @recipe.errors.any?
#errors
%p
= @recipe.errors.count
Prevented this recipe froms saving
%ul
答案 0 :(得分:0)
在#errors
之前添加两个空格。 Haml缩进是它的基础,它定义了它的代码块,而不是使用结束线,因此您必须尊重它,并且只应使用空格(不使用制表符),并且始终使用相同的数量(常规为2个空格)。