Iván Cortés Romero Iván Cortés Romero - 5 months ago 24
Ruby Question

Haml: syntax error, unexpected keyword_ensure, expecting end-of-input

In my project, I am using

haml
to code the views, and in this partial, server shows
syntax error, unexpected keyword_ensure, expecting end-of-input
error:

.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"


the error points line 13, the last one.

Answer

i think correct syntax is

= form_tag admin_articles_posts_path do