Haml:语法错误,意外的keyword_ensure,期望输入结束

时间:2016-07-04 12:24:35

标签: ruby-on-rails ruby haml

在我的项目中,我使用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行,最后一行。

1 个答案:

答案 0 :(得分:1)

我认为正确的语法是

= form_tag admin_articles_posts_path do