【问题标题】:SyntaxError at /images/new syntax error, unexpected tSTRING_DEND, expecting ')'/images/new 语法错误处的 SyntaxError,意外 tSTRING_DEND,期待 ')'
【发布时间】:2016-08-13 23:18:48
【问题描述】:

我是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'}   

你能帮忙吗?谢谢

【问题讨论】:

    标签: ruby-on-rails forms haml erb


    【解决方案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'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-12
      • 2014-04-22
      • 2019-12-06
      • 2013-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多