我刚开始玩haml,我试图了解我做错了什么。
文章/edit.html.haml
=render partial: 'form', f: f
.submit_field
=f.submit "Update Article"
文章/_form.html.haml
=form_for @article do |f|
-if @article.errors.any?
#error_explanation
%h2
=pluralize(@article.errors.count, "error")
prohibited this task from being saved:
%ul
-@article.errors.full_messages.each do |msg|
%li=msg
.text_field
=f.label :title
%br
=f.text_field :title
.text_field
=f.label :body
%br
=f.text_area :body, {rows: 10, cols: 40}
我收到此错误:语法错误,意外的keyword_ensure,期望 $end at .submit_field 。谁能指出我正确的方向?