在我的项目中,我使用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行,最后一行。
答案 0 :(得分:1)
我认为正确的语法是
= form_tag admin_articles_posts_path do