【发布时间】:2016-07-04 12:24:35
【问题描述】:
在我的项目中,我使用haml 对视图进行编码,在这部分中,服务器显示syntax error, unexpected keyword_ensure, expecting end-of-input 错误:
.col-xs-12#new_posts_form
%h2= "New posts"
= form_tag admin_articles_posts_path
- @posts.each_with_index do |post,i|
= fields_for "posts[#{i}]", post do |f|
.col-xs-12
%label Content
= f.text_area :content, placeholder: "Content", class: "form-control"
.col-xs-12
%label Publishing date
=f.date_field :start_date, placeholder: "yyyy-mm-dd", class: "form-control"
.col-xs-12
= f.submit "Next", class: "btn btn-default"
错误点第 13 行,最后一行。
【问题讨论】:
-
我认为缺少“do” = form_tag admin_articles_posts_path
-
是的,就是这样!你能写一个答案来选择它吗?
标签: ruby-on-rails ruby haml