语法错误/ images / new语法错误,意外tSTRING_DEND,期待')'

时间:2016-08-13 23:18:49

标签: ruby-on-rails forms haml erb

我是haml的新手,这是我第一次使用它。我在Haml中有一个表单来创建标签。我正在接受

Syntax error: unexpected tString_DEND expecting ')'.
unexpected tIDENTIFIER, expecting ')'
haml_temp =  f.content_tag :div, "", class: "container_button" do

产生错误的行是:

= f.text_area :tag_list, label: "Tags (optional)", help: raw("All tags .<br>We do this to ensure..."), input_html:{data:{placeholder: "Enter tags", saved: f.object.tags.map{|t|{id: t.name, name:t.name}}.to_json}, url: autocomplete_tags_path}, class: 'tagselect'}   
你能帮帮忙吗?感谢

1 个答案:

答案 0 :(得分:1)

您发布的f.textarea行最后会额外加}。这是没有无关}

的代码
= f.text_area :tag_list, label: "Tags (optional)", help: raw("All tags .<br>We do this to ensure..."), input_html:{data:{placeholder: "Enter tags", saved: f.object.tags.map{|t|{id: t.name, name:t.name}}.to_json}, url: autocomplete_tags_path}, class: 'tagselect'